#1 Job Management feature.

This commit is contained in:
Shinsuke Sugaya 2013-09-27 21:30:11 +09:00
parent 62bf0ed3f5
commit a93746f521
227 changed files with 19089 additions and 2107 deletions

15
.gitignore vendored
View file

@ -1,6 +1,15 @@
/target
/work
/bin
/target/
/work/
/bin/
/mydbflute/
/solr/data/
/src/main/webapp/WEB-INF/classes/
/src/main/webapp/WEB-INF/lib/
/src/main/webapp/jar/
/dbflute_h2/log/*.log
/dbflute_mysql/log/*.log
/dbflute_oracle/log/*.log
/src/main/webapp/WEB-INF/conf/*.properties
/src/main/webapp/WEB-INF/db/*.lock.db
/src/main/webapp/WEB-INF/logs/fess*
.classpath

View file

@ -2,7 +2,7 @@
set ANT_OPTS=-Xmx512m
set DBFLUTE_HOME=..\mydbflute\dbflute-1.0.4H
set DBFLUTE_HOME=..\mydbflute\dbflute-1.0.4K
set MY_PROJECT_NAME=h2

View file

@ -2,7 +2,7 @@
export ANT_OPTS=-Xmx512m
export DBFLUTE_HOME=../mydbflute/dbflute-1.0.4H
export DBFLUTE_HOME=../mydbflute/dbflute-1.0.4K
export MY_PROJECT_NAME=h2

View file

@ -2,7 +2,7 @@
set ANT_OPTS=-Xmx512m
set DBFLUTE_HOME=..\mydbflute\dbflute-1.0.4H
set DBFLUTE_HOME=..\mydbflute\dbflute-1.0.4K
set MY_PROJECT_NAME=fess

View file

@ -2,7 +2,7 @@
export ANT_OPTS=-Xmx512m
export DBFLUTE_HOME=../mydbflute/dbflute-1.0.4H
export DBFLUTE_HOME=../mydbflute/dbflute-1.0.4K
export MY_PROJECT_NAME=fess

View file

@ -2,7 +2,7 @@
set ANT_OPTS=-Xmx512m
set DBFLUTE_HOME=..\mydbflute\dbflute-1.0.4H
set DBFLUTE_HOME=..\mydbflute\dbflute-1.0.4K
set MY_PROJECT_NAME=fess

View file

@ -2,7 +2,7 @@
export ANT_OPTS=-Xmx512m
export DBFLUTE_HOME=../mydbflute/dbflute-1.0.4H
export DBFLUTE_HOME=../mydbflute/dbflute-1.0.4K
export MY_PROJECT_NAME=fess

27
pom.xml
View file

@ -33,7 +33,7 @@
</developer>
</developers>
<issueManagement>
<url><![CDATA[http://sourceforge.jp/projects/fess/ticket/]]></url>
<url>https://github.com/codelibs/fess/issues</url>
</issueManagement>
<distributionManagement>
<repository>
@ -46,9 +46,9 @@
</site>
</distributionManagement>
<scm>
<connection>scm:svn:http://svn.sourceforge.jp/svnroot/fess/fess/trunk</connection>
<developerConnection>scm:svn:https://svn.sourceforge.jp/svnroot/fess/fess/trunk</developerConnection>
<url>http://sourceforge.jp/projects/fess/svn/view/</url>
<connection>scm:git:git@github.com:codelibs/fess.git</connection>
<developerConnection>scm:git:git@github.com:codelibs/fess.git</developerConnection>
<url>https://github.com/codelibs/fess</url>
</scm>
<mailingLists>
<mailingList>
@ -262,16 +262,16 @@
<plugin>
<groupId>org.seasar.dbflute</groupId>
<artifactId>dbflute-maven-plugin</artifactId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>jp.sf.fess</groupId>
<artifactId>fess-crud-template</artifactId>
<version>1.0.0</version>
<version>1.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<configuration>
<dbfluteVersion>1.0.4H</dbfluteVersion>
<dbfluteVersion>1.0.4K</dbfluteVersion>
<rootPackage>jp.sf.fess</rootPackage>
<dbPackage>jp.sf.fess.db</dbPackage>
<actionPackageName>action.admin</actionPackageName>
@ -633,12 +633,12 @@
<dependency>
<groupId>org.seasar.dbflute</groupId>
<artifactId>dbflute-runtime</artifactId>
<version>1.0.4H</version>
<version>1.0.4K</version>
</dependency>
<dependency>
<groupId>jp.sf.fess.chronos</groupId>
<artifactId>s2chronos-extension</artifactId>
<version>1.0.2</version>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.0</version>
</dependency>
<!-- Geronimo -->
<dependency>
@ -819,6 +819,11 @@
<artifactId>handlebars</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.1.7</version>
</dependency>
<!-- Removed from war -->
<dependency>
<groupId>junit</groupId>

View file

@ -22,6 +22,8 @@ DROP TABLE IF EXISTS REQUEST_HEADER;
DROP TABLE IF EXISTS OVERLAPPING_HOST;
DROP TABLE IF EXISTS CRAWLING_SESSION;
DROP TABLE IF EXISTS PATH_MAPPING;
DROP TABLE IF EXISTS JOB_LOG;
DROP TABLE IF EXISTS SCHEDULED_JOB;
DROP TABLE IF EXISTS FILE_CONFIG_TO_BROWSER_TYPE_MAPPING;
DROP TABLE IF EXISTS WEB_CONFIG_TO_BROWSER_TYPE_MAPPING;
DROP TABLE IF EXISTS FILE_CRAWLING_CONFIG;
@ -124,6 +126,43 @@ CREATE TABLE FILE_CONFIG_TO_BROWSER_TYPE_MAPPING(
FOREIGN KEY (BROWSER_TYPE_ID) REFERENCES BROWSER_TYPE (ID)
);
/**********************************/
/* Table Name: Scheduled Job */
/**********************************/
CREATE TABLE SCHEDULED_JOB(
ID IDENTITY NOT NULL PRIMARY KEY,
NAME VARCHAR(100) NOT NULL,
TARGET VARCHAR(100) NOT NULL,
CRON_EXPRESSION VARCHAR(100) NOT NULL,
SCRIPT_TYPE VARCHAR(100) NOT NULL,
SCRIPT_DATA VARCHAR(4000),
CRAWLER VARCHAR(1) NOT NULL,
JOB_LOGGING VARCHAR(1) NOT NULL,
SORT_ORDER INTEGER NOT NULL,
CREATED_BY VARCHAR(255) NOT NULL,
CREATED_TIME TIMESTAMP NOT NULL,
UPDATED_BY VARCHAR(255),
UPDATED_TIME TIMESTAMP,
DELETED_BY VARCHAR(255),
DELETED_TIME TIMESTAMP,
VERSION_NO INTEGER NOT NULL
);
/**********************************/
/* Table Name: Job Log */
/**********************************/
CREATE TABLE JOB_LOG(
ID IDENTITY NOT NULL PRIMARY KEY,
JOB_NAME VARCHAR(100) NOT NULL,
JOB_STATUS VARCHAR(10) NOT NULL,
TARGET VARCHAR(100) NOT NULL,
SCRIPT_TYPE VARCHAR(100) NOT NULL,
SCRIPT_DATA VARCHAR(4000),
SCRIPT_RESULT VARCHAR(4000),
START_TIME TIMESTAMP NOT NULL,
END_TIME TIMESTAMP NOT NULL
);
/**********************************/
/* Table Name: Path Mapping */
/**********************************/
@ -514,4 +553,9 @@ INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME,
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (3, 'au', 'au', 3, 'admin', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (4, 'Softbank', 'softbank', 4, 'admin', '2000-01-01 00:00:00', 1);
INSERT INTO PUBLIC.SCHEDULED_JOB(ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DELETED_BY, DELETED_TIME, VERSION_NO) VALUES
(1, 'Crawler', 'all', '0 0 0 * * ?', 'groovy', 'return container.getComponent("crawlJob").execute(executor);', 'T', 'T', 0, 'system', TIMESTAMP '2013-01-01 00:00:00.000', 'system', TIMESTAMP '2013-01-01 00:00:00.000', NULL, NULL, 0),
(2, 'Minutely', 'all', '0 * * * * ?', 'groovy', 'return container.getComponent("minutelyJob").execute();', 'F', 'F', 10, 'system', TIMESTAMP '2013-01-01 00:00:00.000', 'system', TIMESTAMP '2013-01-01 00:00:00.000', NULL, NULL, 0),
(3, 'Hourly', 'all', '0 0 * * * ?', 'groovy', 'return container.getComponent("houryJob").execute();', 'F', 'F', 20, 'system', TIMESTAMP '2013-01-01 00:00:00.000', 'system', TIMESTAMP '2013-01-01 00:00:00.000', NULL, NULL, 0),
(4, 'Daily', 'all', '0 0 0 * * ?', 'groovy', 'return container.getComponent("dailyJob").execute();', 'F', 'F', 30, 'system', TIMESTAMP '2013-01-01 00:00:00.000', 'system', TIMESTAMP '2013-01-01 00:00:00.000', NULL, NULL, 0);

View file

@ -22,6 +22,8 @@ DROP TABLE IF EXISTS REQUEST_HEADER;
DROP TABLE IF EXISTS OVERLAPPING_HOST;
DROP TABLE IF EXISTS CRAWLING_SESSION;
DROP TABLE IF EXISTS PATH_MAPPING;
DROP TABLE IF EXISTS JOB_LOG;
DROP TABLE IF EXISTS SCHEDULED_JOB;
DROP TABLE IF EXISTS FILE_CONFIG_TO_BROWSER_TYPE_MAPPING;
DROP TABLE IF EXISTS WEB_CONFIG_TO_BROWSER_TYPE_MAPPING;
DROP TABLE IF EXISTS FILE_CRAWLING_CONFIG;
@ -124,6 +126,43 @@ CREATE TABLE FILE_CONFIG_TO_BROWSER_TYPE_MAPPING(
FOREIGN KEY (BROWSER_TYPE_ID) REFERENCES BROWSER_TYPE (ID)
);
/**********************************/
/* Table Name: Scheduled Job */
/**********************************/
CREATE TABLE SCHEDULED_JOB(
ID BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
NAME VARCHAR(100) NOT NULL,
TARGET VARCHAR(100) NOT NULL,
CRON_EXPRESSION VARCHAR(100) NOT NULL,
SCRIPT_TYPE VARCHAR(100) NOT NULL,
SCRIPT_DATA TEXT,
CRAWLER VARCHAR(1) NOT NULL,
JOB_LOGGING VARCHAR(1) NOT NULL,
SORT_ORDER INTEGER NOT NULL,
CREATED_BY VARCHAR(255) NOT NULL,
CREATED_TIME TIMESTAMP NOT NULL,
UPDATED_BY VARCHAR(255),
UPDATED_TIME TIMESTAMP,
DELETED_BY VARCHAR(255),
DELETED_TIME TIMESTAMP,
VERSION_NO INTEGER NOT NULL
);
/**********************************/
/* Table Name: Job Log */
/**********************************/
CREATE TABLE JOB_LOG(
ID BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
JOB_NAME VARCHAR(100) NOT NULL,
JOB_STATUS VARCHAR(10) NOT NULL,
TARGET VARCHAR(100) NOT NULL,
SCRIPT_TYPE VARCHAR(100) NOT NULL,
SCRIPT_DATA TEXT,
SCRIPT_RESULT TEXT,
START_TIME TIMESTAMP NOT NULL,
END_TIME TIMESTAMP NOT NULL
);
/**********************************/
/* Table Name: Path Mapping */
/**********************************/
@ -509,9 +548,13 @@ CREATE INDEX IDX_SEARCH_FIELD_LOG_NAME ON SEARCH_FIELD_LOG (NAME);
CREATE INDEX IDX_SESSION_NAME_EXPIRED ON CRAWLING_SESSION (NAME, EXPIRED_TIME);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (1, 'PC', 'pc', 1, 'admin', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (2, 'DoCoMo', 'docomo', 2, 'admin', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (3, 'au', 'au', 3, 'admin', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (4, 'Softbank', 'softbank', 4, 'admin', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (1, 'PC', 'pc', 1, 'system', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (2, 'DoCoMo', 'docomo', 2, 'system', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (3, 'au', 'au', 3, 'system', '2000-01-01 00:00:00', 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (4, 'Softbank', 'softbank', 4, 'system', '2000-01-01 00:00:00', 1);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (1, 'Crawler', 'all', '0 0 0 * * ?', 'groovy', 'return container.getComponent("crawlJob").execute(executor);', 'T', 'T', 0, 'system', '2000-01-01 00:00:00', 'system', '2000-01-01 00:00:00', 0);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (2, 'Minutely', 'all', '0 * * * * ?', 'groovy', 'return container.getComponent("minutelyJob").execute();', 'F', 'F', 10, 'system', '2000-01-01 00:00:00', 'system', '2000-01-01 00:00:00', 0);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (3, 'Hourly', 'all', '0 0 * * * ?', 'groovy', 'return container.getComponent("houryJob").execute();', 'F', 'F', 20, 'system', '2000-01-01 00:00:00', 'system', '2000-01-01 00:00:00', 0);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (4, 'Daily', 'all', '0 0 0 * * ?', 'groovy', 'return container.getComponent("dailyJob").execute();', 'F', 'F', 30, 'system', '2000-01-01 00:00:00', 'system', '2000-01-01 00:00:00', 0);

View file

@ -3,6 +3,8 @@ DROP SEQUENCE BROWSER_TYPE_SEQ;
DROP SEQUENCE FILE_CRAWLING_CONFIG_SEQ;
DROP SEQUENCE WEB_CONFIG_TO_B_TYPE_SEQ;
DROP SEQUENCE FILE_CONFIG_TO_B_TYPE_SEQ;
DROP SEQUENCE JOB_LOG_SEQ;
DROP SEQUENCE SCHEDULED_JOB_SEQ;
DROP SEQUENCE PATH_MAPPING_SEQ;
DROP SEQUENCE CRAWLING_SESSION_SEQ;
DROP SEQUENCE OVERLAPPING_HOST_SEQ;
@ -52,6 +54,8 @@ DROP TABLE "REQUEST_HEADER";
DROP TABLE "OVERLAPPING_HOST";
DROP TABLE "CRAWLING_SESSION";
DROP TABLE "PATH_MAPPING";
DROP TABLE "SCHEDULED_JOB";
DROP TABLE "JOB_LOG";
DROP TABLE "FILE_CONFIG_TO_B_TYPE";
DROP TABLE "WEB_CONFIG_TO_B_TYPE";
DROP TABLE "FILE_CRAWLING_CONFIG";
@ -149,6 +153,41 @@ CREATE TABLE "FILE_CONFIG_TO_B_TYPE"(
FOREIGN KEY (BROWSER_TYPE_ID) REFERENCES BROWSER_TYPE (ID)
);
CREATE TABLE "SCHEDULED_JOB"(
"ID" NUMBER(18,0) NOT NULL,
"NAME" VARCHAR2(100) NOT NULL,
"TARGET" VARCHAR2(100) NOT NULL,
"CRON_EXPRESSION" VARCHAR2(100) NOT NULL,
"SCRIPT_TYPE" VARCHAR2(100) NOT NULL,
"SCRIPT_DATA" VARCHAR2(4000),
"CRAWLER" VARCHAR2(1) NOT NULL,
"JOB_LOGGING" VARCHAR2(1) NOT NULL,
"SORT_ORDER" NUMBER(9,0) NOT NULL,
"CREATED_BY" VARCHAR2(255) NOT NULL,
"CREATED_TIME" TIMESTAMP NOT NULL,
"UPDATED_BY" VARCHAR2(255),
"UPDATED_TIME" TIMESTAMP,
"DELETED_BY" VARCHAR2(255),
"DELETED_TIME" TIMESTAMP,
"VERSION_NO" NUMBER(9,0) NOT NULL,
CONSTRAINT "SCHEDULED_JOB_PK" PRIMARY KEY ("ID") ENABLE
);
CREATE TABLE "JOB_LOG"(
"ID" NUMBER(18,0) NOT NULL,
"JOB_NAME" VARCHAR2(100) NOT NULL,
"JOB_STATUS" VARCHAR2(10) NOT NULL,
"TARGET" VARCHAR2(100) NOT NULL,
"SCRIPT_TYPE" VARCHAR2(100) NOT NULL,
"SCRIPT_DATA" VARCHAR2(4000),
"SCRIPT_RESULT" VARCHAR2(4000),
"START_TIME" TIMESTAMP NOT NULL,
"END_TIME" TIMESTAMP NOT NULL,
CONSTRAINT "JOB_LOG_PK" PRIMARY KEY ("ID") ENABLE
);
CREATE TABLE "PATH_MAPPING"(
"ID" NUMBER(18,0) NOT NULL,
"REGEX" VARCHAR2(1000) NOT NULL,
@ -511,10 +550,12 @@ CREATE INDEX IDX_S_F_LOG_NAME ON SEARCH_FIELD_LOG (NAME);
CREATE INDEX IDX_S_N_EXPIRED ON CRAWLING_SESSION (NAME, EXPIRED_TIME);
CREATE SEQUENCE WEB_CRAWLING_CONFIG_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE BROWSER_TYPE_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE BROWSER_TYPE_SEQ START WITH 5 INCREMENT BY 50;
CREATE SEQUENCE FILE_CRAWLING_CONFIG_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE WEB_CONFIG_TO_B_TYPE_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE FILE_CONFIG_TO_B_TYPE_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE JOB_LOG_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE SCHEDULED_JOB_SEQ START WITH 5 INCREMENT BY 50;
CREATE SEQUENCE PATH_MAPPING_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE CRAWLING_SESSION_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE OVERLAPPING_HOST_SEQ START WITH 1 INCREMENT BY 50;
@ -540,9 +581,13 @@ CREATE SEQUENCE FILE_AUTHENTICATION_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE SEARCH_FIELD_LOG_SEQ START WITH 1 INCREMENT BY 50;
CREATE SEQUENCE FAVORITE_LOG_SEQ START WITH 1 INCREMENT BY 50;
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (1, 'PC', 'pc', 1, 'admin', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (2, 'DoCoMo', 'docomo', 2, 'admin', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (3, 'au', 'au', 3, 'admin', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (4, 'Softbank', 'softbank', 4, 'admin', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (1, 'PC', 'pc', 1, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (2, 'DoCoMo', 'docomo', 2, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (3, 'au', 'au', 3, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO BROWSER_TYPE (ID, NAME, VALUE, SORT_ORDER, CREATED_BY, CREATED_TIME, VERSION_NO) VALUES (4, 'Softbank', 'softbank', 4, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 1);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (1, 'Crawler', 'all', '0 0 0 * * ?', 'groovy', 'return container.getComponent("crawlJob").execute(executor);', 'T', 'T', 0, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 0);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (2, 'Minutely', 'all', '0 * * * * ?', 'groovy', 'return container.getComponent("minutelyJob").execute();', 'F', 'F', 10, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 0);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (3, 'Hourly', 'all', '0 0 * * * ?', 'groovy', 'return container.getComponent("houryJob").execute();', 'F', 'F', 20, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 0);
INSERT INTO SCHEDULED_JOB (ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, VERSION_NO) VALUES (4, 'Daily', 'all', '0 0 0 * * ?', 'groovy', 'return container.getComponent("dailyJob").execute();', 'F', 'F', 30, 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 'system', to_date('2000-01-01', 'yyyy-MM-dd'), 0);

View file

@ -1035,6 +1035,121 @@ fileCrawlingConfig.versionNo.doubleTypeParam=
fileCrawlingConfig.versionNo.dateTypeParam=
fileCrawlingConfig.versionNo.defaultValue=
jobLog.ignored=false
jobLog.importPackages=import jp.sf.fess.Constants;import jp.sf.fess.annotation.UriType;import org.seasar.struts.annotation.Maxbytelength;import org.seasar.struts.annotation.IntRange;import org.seasar.struts.annotation.LongRange;import org.seasar.struts.annotation.Mask;import org.seasar.struts.annotation.Msg;
jobLog.converterToSearchParams=
jobLog.converterToPager=
jobLog.converterToActionForm=
jobLog.converterToEntity=
jobLog.id.requiredParam=
jobLog.id.additionalAnnotation=
jobLog.id.annotation=
jobLog.id.enableJavaType=true
jobLog.id.longTypeParam=
jobLog.id.integerTypeParam=
jobLog.id.shortTypeParam=
jobLog.id.byteTypeParam=
jobLog.id.floatTypeParam=
jobLog.id.doubleTypeParam=
jobLog.id.dateTypeParam=
jobLog.id.defaultValue=
jobLog.jobName.requiredParam=
jobLog.jobName.additionalAnnotation=
jobLog.jobName.annotation=
jobLog.jobName.enableJavaType=true
jobLog.jobName.longTypeParam=
jobLog.jobName.integerTypeParam=
jobLog.jobName.shortTypeParam=
jobLog.jobName.byteTypeParam=
jobLog.jobName.floatTypeParam=
jobLog.jobName.doubleTypeParam=
jobLog.jobName.dateTypeParam=
jobLog.jobName.defaultValue=
jobLog.jobStatus.requiredParam=
jobLog.jobStatus.additionalAnnotation=
jobLog.jobStatus.annotation=
jobLog.jobStatus.enableJavaType=true
jobLog.jobStatus.longTypeParam=
jobLog.jobStatus.integerTypeParam=
jobLog.jobStatus.shortTypeParam=
jobLog.jobStatus.byteTypeParam=
jobLog.jobStatus.floatTypeParam=
jobLog.jobStatus.doubleTypeParam=
jobLog.jobStatus.dateTypeParam=
jobLog.jobStatus.defaultValue=
jobLog.target.requiredParam=
jobLog.target.additionalAnnotation=
jobLog.target.annotation=
jobLog.target.enableJavaType=true
jobLog.target.longTypeParam=
jobLog.target.integerTypeParam=
jobLog.target.shortTypeParam=
jobLog.target.byteTypeParam=
jobLog.target.floatTypeParam=
jobLog.target.doubleTypeParam=
jobLog.target.dateTypeParam=
jobLog.target.defaultValue=
jobLog.scriptType.requiredParam=
jobLog.scriptType.additionalAnnotation=
jobLog.scriptType.annotation=
jobLog.scriptType.enableJavaType=true
jobLog.scriptType.longTypeParam=
jobLog.scriptType.integerTypeParam=
jobLog.scriptType.shortTypeParam=
jobLog.scriptType.byteTypeParam=
jobLog.scriptType.floatTypeParam=
jobLog.scriptType.doubleTypeParam=
jobLog.scriptType.dateTypeParam=
jobLog.scriptType.defaultValue=
jobLog.scriptData.requiredParam=
jobLog.scriptData.additionalAnnotation=
jobLog.scriptData.annotation=
jobLog.scriptData.enableJavaType=true
jobLog.scriptData.longTypeParam=
jobLog.scriptData.integerTypeParam=
jobLog.scriptData.shortTypeParam=
jobLog.scriptData.byteTypeParam=
jobLog.scriptData.floatTypeParam=
jobLog.scriptData.doubleTypeParam=
jobLog.scriptData.dateTypeParam=
jobLog.scriptData.defaultValue=
jobLog.scriptResult.requiredParam=
jobLog.scriptResult.additionalAnnotation=
jobLog.scriptResult.annotation=
jobLog.scriptResult.enableJavaType=true
jobLog.scriptResult.longTypeParam=
jobLog.scriptResult.integerTypeParam=
jobLog.scriptResult.shortTypeParam=
jobLog.scriptResult.byteTypeParam=
jobLog.scriptResult.floatTypeParam=
jobLog.scriptResult.doubleTypeParam=
jobLog.scriptResult.dateTypeParam=
jobLog.scriptResult.defaultValue=
jobLog.startTime.requiredParam=
jobLog.startTime.additionalAnnotation=
jobLog.startTime.annotation=
jobLog.startTime.enableJavaType=true
jobLog.startTime.longTypeParam=
jobLog.startTime.integerTypeParam=
jobLog.startTime.shortTypeParam=
jobLog.startTime.byteTypeParam=
jobLog.startTime.floatTypeParam=
jobLog.startTime.doubleTypeParam=
jobLog.startTime.dateTypeParam=(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
jobLog.startTime.defaultValue=
jobLog.endTime.requiredParam=
jobLog.endTime.additionalAnnotation=
jobLog.endTime.annotation=
jobLog.endTime.enableJavaType=true
jobLog.endTime.longTypeParam=
jobLog.endTime.integerTypeParam=
jobLog.endTime.shortTypeParam=
jobLog.endTime.byteTypeParam=
jobLog.endTime.floatTypeParam=
jobLog.endTime.doubleTypeParam=
jobLog.endTime.dateTypeParam=(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
jobLog.endTime.defaultValue=
labelType.ignored=false
labelType.importPackages=import jp.sf.fess.Constants;import jp.sf.fess.annotation.UriType;import org.seasar.struts.annotation.Maxbytelength;import org.seasar.struts.annotation.IntRange;import org.seasar.struts.annotation.LongRange;import org.seasar.struts.annotation.Mask;import org.seasar.struts.annotation.Msg;
labelType.converterToSearchParams=
@ -1768,6 +1883,205 @@ roleType.versionNo.doubleTypeParam=
roleType.versionNo.dateTypeParam=
roleType.versionNo.defaultValue=
scheduledJob.ignored=false
scheduledJob.importPackages=import jp.sf.fess.Constants;import jp.sf.fess.annotation.UriType;import org.seasar.struts.annotation.Maxbytelength;import org.seasar.struts.annotation.IntRange;import org.seasar.struts.annotation.LongRange;import org.seasar.struts.annotation.Mask;import org.seasar.struts.annotation.Msg;import jp.sf.fess.annotation.CronExpression;
scheduledJob.converterToSearchParams=
scheduledJob.converterToPager=
scheduledJob.converterToActionForm=
scheduledJob.converterToEntity=
scheduledJob.id.requiredParam=
scheduledJob.id.additionalAnnotation=
scheduledJob.id.annotation=
scheduledJob.id.enableJavaType=true
scheduledJob.id.longTypeParam=
scheduledJob.id.integerTypeParam=
scheduledJob.id.shortTypeParam=
scheduledJob.id.byteTypeParam=
scheduledJob.id.floatTypeParam=
scheduledJob.id.doubleTypeParam=
scheduledJob.id.dateTypeParam=
scheduledJob.id.defaultValue=
scheduledJob.name.requiredParam=
scheduledJob.name.additionalAnnotation=@Maxbytelength(maxbytelength = 100)
scheduledJob.name.annotation=
scheduledJob.name.enableJavaType=true
scheduledJob.name.longTypeParam=
scheduledJob.name.integerTypeParam=
scheduledJob.name.shortTypeParam=
scheduledJob.name.byteTypeParam=
scheduledJob.name.floatTypeParam=
scheduledJob.name.doubleTypeParam=
scheduledJob.name.dateTypeParam=
scheduledJob.name.defaultValue=
scheduledJob.target.requiredParam=
scheduledJob.target.additionalAnnotation=@Maxbytelength(maxbytelength = 100)
scheduledJob.target.annotation=
scheduledJob.target.enableJavaType=true
scheduledJob.target.longTypeParam=
scheduledJob.target.integerTypeParam=
scheduledJob.target.shortTypeParam=
scheduledJob.target.byteTypeParam=
scheduledJob.target.floatTypeParam=
scheduledJob.target.doubleTypeParam=
scheduledJob.target.dateTypeParam=
scheduledJob.target.defaultValue=
scheduledJob.cronExpression.requiredParam=
scheduledJob.cronExpression.additionalAnnotation=@Maxbytelength(maxbytelength = 100)@CronExpression
scheduledJob.cronExpression.annotation=
scheduledJob.cronExpression.enableJavaType=true
scheduledJob.cronExpression.longTypeParam=
scheduledJob.cronExpression.integerTypeParam=
scheduledJob.cronExpression.shortTypeParam=
scheduledJob.cronExpression.byteTypeParam=
scheduledJob.cronExpression.floatTypeParam=
scheduledJob.cronExpression.doubleTypeParam=
scheduledJob.cronExpression.dateTypeParam=
scheduledJob.cronExpression.defaultValue=
scheduledJob.scriptType.requiredParam=
scheduledJob.scriptType.additionalAnnotation=@Maxbytelength(maxbytelength = 100)
scheduledJob.scriptType.annotation=
scheduledJob.scriptType.enableJavaType=true
scheduledJob.scriptType.longTypeParam=
scheduledJob.scriptType.integerTypeParam=
scheduledJob.scriptType.shortTypeParam=
scheduledJob.scriptType.byteTypeParam=
scheduledJob.scriptType.floatTypeParam=
scheduledJob.scriptType.doubleTypeParam=
scheduledJob.scriptType.dateTypeParam=
scheduledJob.scriptType.defaultValue=
scheduledJob.scriptData.requiredParam=
scheduledJob.scriptData.additionalAnnotation=@Maxbytelength(maxbytelength = 4000)
scheduledJob.scriptData.annotation=
scheduledJob.scriptData.enableJavaType=true
scheduledJob.scriptData.longTypeParam=
scheduledJob.scriptData.integerTypeParam=
scheduledJob.scriptData.shortTypeParam=
scheduledJob.scriptData.byteTypeParam=
scheduledJob.scriptData.floatTypeParam=
scheduledJob.scriptData.doubleTypeParam=
scheduledJob.scriptData.dateTypeParam=
scheduledJob.scriptData.defaultValue=
scheduledJob.crawler.requiredParam=
scheduledJob.crawler.additionalAnnotation=
scheduledJob.crawler.annotation=// ignore
scheduledJob.crawler.enableJavaType=true
scheduledJob.crawler.longTypeParam=
scheduledJob.crawler.integerTypeParam=
scheduledJob.crawler.shortTypeParam=
scheduledJob.crawler.byteTypeParam=
scheduledJob.crawler.floatTypeParam=
scheduledJob.crawler.doubleTypeParam=
scheduledJob.crawler.dateTypeParam=
scheduledJob.crawler.defaultValue=
scheduledJob.jobLogging.requiredParam=
scheduledJob.jobLogging.additionalAnnotation=
scheduledJob.jobLogging.annotation=// ignore
scheduledJob.jobLogging.enableJavaType=true
scheduledJob.jobLogging.longTypeParam=
scheduledJob.jobLogging.integerTypeParam=
scheduledJob.jobLogging.shortTypeParam=
scheduledJob.jobLogging.byteTypeParam=
scheduledJob.jobLogging.floatTypeParam=
scheduledJob.jobLogging.doubleTypeParam=
scheduledJob.jobLogging.dateTypeParam=
scheduledJob.jobLogging.defaultValue=
scheduledJob.sortOrder.requiredParam=
scheduledJob.sortOrder.additionalAnnotation=@IntRange(min = 0, max = 2147483647)
scheduledJob.sortOrder.annotation=
scheduledJob.sortOrder.enableJavaType=true
scheduledJob.sortOrder.longTypeParam=
scheduledJob.sortOrder.integerTypeParam=
scheduledJob.sortOrder.shortTypeParam=
scheduledJob.sortOrder.byteTypeParam=
scheduledJob.sortOrder.floatTypeParam=
scheduledJob.sortOrder.doubleTypeParam=
scheduledJob.sortOrder.dateTypeParam=
scheduledJob.sortOrder.defaultValue=
scheduledJob.createdBy.requiredParam=(target = "confirmfromupdate,update,delete")
scheduledJob.createdBy.additionalAnnotation=
scheduledJob.createdBy.annotation=
scheduledJob.createdBy.enableJavaType=true
scheduledJob.createdBy.longTypeParam=
scheduledJob.createdBy.integerTypeParam=
scheduledJob.createdBy.shortTypeParam=
scheduledJob.createdBy.byteTypeParam=
scheduledJob.createdBy.floatTypeParam=
scheduledJob.createdBy.doubleTypeParam=
scheduledJob.createdBy.dateTypeParam=
scheduledJob.createdBy.defaultValue=
scheduledJob.createdTime.requiredParam=(target = "confirmfromupdate,update,delete")
scheduledJob.createdTime.additionalAnnotation=
scheduledJob.createdTime.annotation=
scheduledJob.createdTime.enableJavaType=true
scheduledJob.createdTime.longTypeParam=
scheduledJob.createdTime.integerTypeParam=
scheduledJob.createdTime.shortTypeParam=
scheduledJob.createdTime.byteTypeParam=
scheduledJob.createdTime.floatTypeParam=
scheduledJob.createdTime.doubleTypeParam=
scheduledJob.createdTime.dateTypeParam=(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
scheduledJob.createdTime.defaultValue=
scheduledJob.updatedBy.requiredParam=(target = "confirmfromupdate,update,delete")
scheduledJob.updatedBy.additionalAnnotation=
scheduledJob.updatedBy.annotation=
scheduledJob.updatedBy.enableJavaType=true
scheduledJob.updatedBy.longTypeParam=
scheduledJob.updatedBy.integerTypeParam=
scheduledJob.updatedBy.shortTypeParam=
scheduledJob.updatedBy.byteTypeParam=
scheduledJob.updatedBy.floatTypeParam=
scheduledJob.updatedBy.doubleTypeParam=
scheduledJob.updatedBy.dateTypeParam=
scheduledJob.updatedBy.defaultValue=
scheduledJob.updatedTime.requiredParam=(target = "confirmfromupdate,update,delete")
scheduledJob.updatedTime.additionalAnnotation=
scheduledJob.updatedTime.annotation=
scheduledJob.updatedTime.enableJavaType=true
scheduledJob.updatedTime.longTypeParam=
scheduledJob.updatedTime.integerTypeParam=
scheduledJob.updatedTime.shortTypeParam=
scheduledJob.updatedTime.byteTypeParam=
scheduledJob.updatedTime.floatTypeParam=
scheduledJob.updatedTime.doubleTypeParam=
scheduledJob.updatedTime.dateTypeParam=(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
scheduledJob.updatedTime.defaultValue=
scheduledJob.deletedBy.requiredParam=
scheduledJob.deletedBy.additionalAnnotation=
scheduledJob.deletedBy.annotation=
scheduledJob.deletedBy.enableJavaType=true
scheduledJob.deletedBy.longTypeParam=
scheduledJob.deletedBy.integerTypeParam=
scheduledJob.deletedBy.shortTypeParam=
scheduledJob.deletedBy.byteTypeParam=
scheduledJob.deletedBy.floatTypeParam=
scheduledJob.deletedBy.doubleTypeParam=
scheduledJob.deletedBy.dateTypeParam=
scheduledJob.deletedBy.defaultValue=
scheduledJob.deletedTime.requiredParam=
scheduledJob.deletedTime.additionalAnnotation=
scheduledJob.deletedTime.annotation=
scheduledJob.deletedTime.enableJavaType=true
scheduledJob.deletedTime.longTypeParam=
scheduledJob.deletedTime.integerTypeParam=
scheduledJob.deletedTime.shortTypeParam=
scheduledJob.deletedTime.byteTypeParam=
scheduledJob.deletedTime.floatTypeParam=
scheduledJob.deletedTime.doubleTypeParam=
scheduledJob.deletedTime.dateTypeParam=(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
scheduledJob.deletedTime.defaultValue=
scheduledJob.versionNo.requiredParam=(target = "confirmfromupdate,update,delete")
scheduledJob.versionNo.additionalAnnotation=
scheduledJob.versionNo.annotation=
scheduledJob.versionNo.enableJavaType=true
scheduledJob.versionNo.longTypeParam=
scheduledJob.versionNo.integerTypeParam=
scheduledJob.versionNo.shortTypeParam=
scheduledJob.versionNo.byteTypeParam=
scheduledJob.versionNo.floatTypeParam=
scheduledJob.versionNo.doubleTypeParam=
scheduledJob.versionNo.dateTypeParam=
scheduledJob.versionNo.defaultValue=
searchFieldLog.ignored=true
searchLog.ignored=false

View file

@ -56,6 +56,10 @@ public class Constants extends CoreLibConstants {
public static final String DONE = "done";
public static final String OK = "ok";
public static final String FAIL = "fail";
public static final String ITEM_LABEL = "label";
public static final String ITEM_VALUE = "value";
@ -66,6 +70,10 @@ public class Constants extends CoreLibConstants {
public static final String MS932 = "MS932";
public static final String OPTIMIZE = "optimize";
public static final String COMMIT = "commit";
public static final String DEFAULT_CRON_EXPRESSION = "0 0 0 * * ?";
public static final String DEFAULT_SEARCH_LOG_CRON_EXPRESSION = "0 * * * * ?";
@ -109,20 +117,8 @@ public class Constants extends CoreLibConstants {
public static final String CRAWLING_THREAD_COUNT_PROPERTY = "crawling.thread.count";
public static final String CRON_EXPRESSION_PROPERTY = "cron.expression";
public static final String SEARCH_LOG_CRON_EXPRESSION_PROPERTY = "cron.expression.searchlog";
public static final String DAILY_CRON_EXPRESSION_PROPERTY = "cron.expression.daily";
public static final String HOURLY_CRON_EXPRESSION_PROPERTY = "cron.expression.hourly";
public static final String DAY_FOR_CLEANUP_PROPERTY = "day.for.cleanup";
public static final String OPTIMIZE_PROPERTY = "optimize.index";
public static final String COMMIT_PROPERTY = "commit.index";
public static final String COMMIT_PER_COUNT_PROPERTY = "commit.count";
public static final String SERVER_ROTATION_PROPERTY = "server.rotation";
@ -151,10 +147,12 @@ public class Constants extends CoreLibConstants {
public static final String CSV_FILE_ENCODING_PROPERTY = "csv.file.encoding";
public static final String PURGE_SERCH_LOG_DAY_PROPERTY = "purge.searchlog.day";
public static final String PURGE_SEARCH_LOG_DAY_PROPERTY = "purge.searchlog.day";
public static final String PURGE_USER_INFO_DAY_PROPERTY = "purge.userinfo.day";
public static final String PURGE_JOB_LOG_DAY_PROPERTY = "purge.joblog.day";
public static final String PURGE_BY_BOTS_PROPERTY = "purge.by.bots";
public static final String SEARCH_DESKTOP_PROPERTY = "search.desktop";
@ -301,4 +299,15 @@ public class Constants extends CoreLibConstants {
public static final String OPTION_QUERY_NQ = "nq";
// job
public static final String JOB_ID_PREFIX = "job";
public static final String SCHEDULED_JOB = "scheduledJob";
public static final String JOB_EXECUTOR_TYPE = "jobExecutor";
public static final String DEFAULT_JOB_TARGET = "all";
public static final String DEFAULT_JOB_SCRIPT_TYPE = "groovy";
}

View file

@ -60,17 +60,8 @@ public class CrawlAction implements Serializable {
}
protected String showIndex(final boolean redirect) {
crawlForm.cronExpression = crawlerProperties.getProperty(
Constants.CRON_EXPRESSION_PROPERTY,
Constants.DEFAULT_CRON_EXPRESSION);
crawlForm.diffCrawling = crawlerProperties.getProperty(
Constants.DIFF_CRAWLING_PROPERTY, Constants.TRUE);
crawlForm.useAclAsRole = crawlerProperties.getProperty(
Constants.USE_ACL_AS_ROLE, Constants.FALSE);
crawlForm.optimize = crawlerProperties.getProperty(
Constants.OPTIMIZE_PROPERTY, Constants.FALSE);
crawlForm.commit = crawlerProperties.getProperty(
Constants.COMMIT_PROPERTY, Constants.TRUE);
crawlForm.serverRotation = crawlerProperties.getProperty(
Constants.SERVER_ROTATION_PROPERTY, Constants.FALSE);
crawlForm.dayForCleanup = crawlerProperties.getProperty(
@ -114,7 +105,10 @@ public class CrawlAction implements Serializable {
crawlForm.csvFileEncoding = crawlerProperties.getProperty(
Constants.CSV_FILE_ENCODING_PROPERTY, Constants.UTF_8);
crawlForm.purgeSearchLogDay = crawlerProperties.getProperty(
Constants.PURGE_SERCH_LOG_DAY_PROPERTY,
Constants.PURGE_SEARCH_LOG_DAY_PROPERTY,
Constants.DEFAULT_PURGE_DAY);
crawlForm.purgeJobLogDay = crawlerProperties.getProperty(
Constants.PURGE_JOB_LOG_DAY_PROPERTY,
Constants.DEFAULT_PURGE_DAY);
crawlForm.purgeUserInfoDay = crawlerProperties.getProperty(
Constants.PURGE_USER_INFO_DAY_PROPERTY,
@ -140,15 +134,6 @@ public class CrawlAction implements Serializable {
@Token(save = false, validate = true)
@Execute(validator = true, input = "index.jsp")
public String update() {
crawlerProperties.setProperty(Constants.CRON_EXPRESSION_PROPERTY,
crawlForm.cronExpression);
crawlerProperties
.setProperty(
Constants.DIFF_CRAWLING_PROPERTY,
crawlForm.diffCrawling != null
&& Constants.ON
.equalsIgnoreCase(crawlForm.diffCrawling) ? Constants.TRUE
: Constants.FALSE);
crawlerProperties
.setProperty(
Constants.USE_ACL_AS_ROLE,
@ -156,20 +141,6 @@ public class CrawlAction implements Serializable {
&& Constants.ON
.equalsIgnoreCase(crawlForm.useAclAsRole) ? Constants.TRUE
: Constants.FALSE);
crawlerProperties
.setProperty(
Constants.OPTIMIZE_PROPERTY,
crawlForm.optimize != null
&& Constants.ON
.equalsIgnoreCase(crawlForm.optimize) ? Constants.TRUE
: Constants.FALSE);
crawlerProperties
.setProperty(
Constants.COMMIT_PROPERTY,
crawlForm.commit != null
&& Constants.ON
.equalsIgnoreCase(crawlForm.commit) ? Constants.TRUE
: Constants.FALSE);
crawlerProperties
.setProperty(
Constants.SERVER_ROTATION_PROPERTY,
@ -260,8 +231,10 @@ public class CrawlAction implements Serializable {
: Constants.FALSE);
crawlerProperties.setProperty(Constants.CSV_FILE_ENCODING_PROPERTY,
crawlForm.csvFileEncoding);
crawlerProperties.setProperty(Constants.PURGE_SERCH_LOG_DAY_PROPERTY,
crawlerProperties.setProperty(Constants.PURGE_SEARCH_LOG_DAY_PROPERTY,
crawlForm.purgeSearchLogDay);
crawlerProperties.setProperty(Constants.PURGE_JOB_LOG_DAY_PROPERTY,
crawlForm.purgeJobLogDay);
crawlerProperties.setProperty(Constants.PURGE_USER_INFO_DAY_PROPERTY,
crawlForm.purgeUserInfoDay);
crawlerProperties.setProperty(Constants.PURGE_BY_BOTS_PROPERTY,

View file

@ -49,7 +49,8 @@ public class CrawlingSessionAction extends BsCrawlingSessionAction {
@Execute(validator = false, input = "error.jsp")
public String deleteall() {
crawlingSessionService.deleteOldSessions(systemHelper.getSessionId());
crawlingSessionService.deleteOldSessions(systemHelper
.getRunningSessionIdSet());
SAStrutsUtil.addSessionMessage("success.crawling_session_delete_all");
return displayList(true);
}

View file

@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
@ -169,7 +170,7 @@ public class DocumentAction implements Serializable {
final Thread thread = new Thread(new Runnable() {
@Override
public void run() {
if (systemHelper.readyCrawlProcess()) {
if (!systemHelper.isCrawlProcessRunning()) {
final long execTime = System.currentTimeMillis();
try {
systemHelper.updateStatus(solrGroup, QueryType.ADD);
@ -184,8 +185,6 @@ public class DocumentAction implements Serializable {
}
} catch (final Exception e) {
logger.error("Failed to commit index.", e);
} finally {
systemHelper.finishCrawlProcess();
}
} else {
if (logger.isInfoEnabled()) {
@ -217,7 +216,7 @@ public class DocumentAction implements Serializable {
final Thread thread = new Thread(new Runnable() {
@Override
public void run() {
if (systemHelper.readyCrawlProcess()) {
if (!systemHelper.isCrawlProcessRunning()) {
final long execTime = System.currentTimeMillis();
try {
systemHelper.updateStatus(solrGroup, QueryType.ADD);
@ -231,8 +230,6 @@ public class DocumentAction implements Serializable {
}
} catch (final Exception e) {
logger.error("Failed to optimize index.", e);
} finally {
systemHelper.finishCrawlProcess();
}
} else {
if (logger.isInfoEnabled()) {
@ -290,7 +287,7 @@ public class DocumentAction implements Serializable {
final Thread thread = new Thread(new Runnable() {
@Override
public void run() {
if (systemHelper.readyCrawlProcess()) {
if (!systemHelper.isCrawlProcessRunning()) {
final long execTime = System.currentTimeMillis();
try {
systemHelper.updateStatus(solrGroup,
@ -307,8 +304,6 @@ public class DocumentAction implements Serializable {
} catch (final Exception e) {
logger.error("Failed to delete index (query="
+ deleteQuery + ").", e);
} finally {
systemHelper.finishCrawlProcess();
}
} else {
if (logger.isInfoEnabled()) {
@ -385,8 +380,8 @@ public class DocumentAction implements Serializable {
return systemHelper.isCrawlProcessRunning();
}
public String getRunningSessionId() {
return systemHelper.getSessionId();
public Set<String> getRunningSessionIdSet() {
return systemHelper.getRunningSessionIdSet();
}
private static class SessionIdList<E> extends ArrayList<E> {

View file

@ -0,0 +1,25 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.action.admin;
import jp.sf.fess.crud.action.admin.BsJobLogAction;
public class JobLogAction extends BsJobLogAction {
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,154 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.action.admin;
import java.sql.Timestamp;
import java.util.List;
import javax.annotation.Resource;
import jp.sf.fess.Constants;
import jp.sf.fess.crud.CommonConstants;
import jp.sf.fess.crud.CrudMessageException;
import jp.sf.fess.crud.action.admin.BsScheduledJobAction;
import jp.sf.fess.crud.util.SAStrutsUtil;
import jp.sf.fess.db.exentity.RoleType;
import jp.sf.fess.db.exentity.ScheduledJob;
import jp.sf.fess.helper.SystemHelper;
import jp.sf.fess.service.RoleTypeService;
import jp.sf.fess.util.FessBeans;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelibs.sastruts.core.exception.SSCActionMessagesException;
import org.seasar.struts.annotation.Execute;
import org.seasar.struts.exception.ActionMessagesException;
public class ScheduledJobAction extends BsScheduledJobAction {
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(ScheduledJobAction.class);
@Resource
protected RoleTypeService roleTypeService;
@Resource
protected SystemHelper systemHelper;
public String getHelpLink() {
return systemHelper.getHelpLink("scheduledJob");
}
@Override
protected void loadScheduledJob() {
final ScheduledJob scheduledJob = scheduledJobService
.getScheduledJob(createKeyMap());
if (scheduledJob == null) {
// throw an exception
throw new SSCActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { scheduledJobForm.id });
}
FessBeans.copy(scheduledJob, scheduledJobForm)
.commonColumnDateConverter()
.excludes("searchParams", "mode", "jobLogging").execute();
scheduledJobForm.jobLogging = scheduledJob.isLoggingEnabled() ? Constants.ON
: null;
scheduledJobForm.crawler = scheduledJob.isCrawlerJob() ? Constants.ON
: null;
}
@Override
protected ScheduledJob createScheduledJob() {
ScheduledJob scheduledJob;
final String username = systemHelper.getUsername();
final Timestamp timestamp = systemHelper.getCurrentTimestamp();
if (scheduledJobForm.crudMode == CommonConstants.EDIT_MODE) {
scheduledJob = scheduledJobService.getScheduledJob(createKeyMap());
if (scheduledJob == null) {
// throw an exception
throw new SSCActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { scheduledJobForm.id });
}
} else {
scheduledJob = new ScheduledJob();
scheduledJob.setCreatedBy(username);
scheduledJob.setCreatedTime(timestamp);
}
scheduledJob.setUpdatedBy(username);
scheduledJob.setUpdatedTime(timestamp);
FessBeans.copy(scheduledJobForm, scheduledJob).excludesCommonColumns()
.execute();
scheduledJob.setJobLogging(Constants.ON
.equals(scheduledJobForm.jobLogging) ? Constants.T
: Constants.F);
scheduledJob
.setCrawler(Constants.ON.equals(scheduledJobForm.crawler) ? Constants.T
: Constants.F);
return scheduledJob;
}
@Override
@Execute(validator = false, input = "error.jsp")
public String delete() {
if (scheduledJobForm.crudMode != CommonConstants.DELETE_MODE) {
throw new SSCActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.DELETE_MODE,
scheduledJobForm.crudMode });
}
try {
final ScheduledJob scheduledJob = scheduledJobService
.getScheduledJob(createKeyMap());
if (scheduledJob == null) {
// throw an exception
throw new SSCActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { scheduledJobForm.id });
}
final String username = systemHelper.getUsername();
final Timestamp timestamp = systemHelper.getCurrentTimestamp();
scheduledJob.setDeletedBy(username);
scheduledJob.setDeletedTime(timestamp);
scheduledJobService.store(scheduledJob);
SAStrutsUtil.addSessionMessage("success.crud_delete_crud_table");
return displayList(true);
} catch (final ActionMessagesException e) {
log.error(e.getMessage(), e);
throw e;
} catch (final CrudMessageException e) {
log.error(e.getMessage(), e);
throw new SSCActionMessagesException(e, e.getMessageId(),
e.getArgs());
} catch (final Exception e) {
log.error(e.getMessage(), e);
throw new SSCActionMessagesException(e,
"errors.crud_failed_to_delete_crud_table");
}
}
public List<RoleType> getRoleTypeItems() {
return roleTypeService.getRoleTypeList();
}
}

View file

@ -260,7 +260,7 @@ public class SearchListAction implements Serializable {
final Thread thread = new Thread(new Runnable() {
@Override
public void run() {
if (systemHelper.readyCrawlProcess()) {
if (!systemHelper.isCrawlProcessRunning()) {
final long time = System.currentTimeMillis();
try {
solrGroup.deleteById(deleteId);
@ -273,8 +273,6 @@ public class SearchListAction implements Serializable {
} catch (final Exception e) {
logger.error("Failed to delete index (query="
+ deleteId + ").", e);
} finally {
systemHelper.finishCrawlProcess();
}
} else {
if (logger.isInfoEnabled()) {

View file

@ -21,15 +21,18 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import jp.sf.fess.Constants;
import jp.sf.fess.crud.util.SAStrutsUtil;
import jp.sf.fess.db.exentity.ScheduledJob;
import jp.sf.fess.form.admin.SystemForm;
import jp.sf.fess.helper.SystemHelper;
import jp.sf.fess.helper.WebManagementHelper;
import jp.sf.fess.task.CrawlTask;
import jp.sf.fess.job.TriggeredJob;
import jp.sf.fess.service.ScheduledJobService;
import org.codelibs.core.util.DynamicProperties;
import org.codelibs.sastruts.core.annotation.Token;
@ -213,15 +216,18 @@ public class SystemAction implements Serializable {
final SolrGroup solrGroup = solrGroupManager.getSolrGroup(groupName);
if (solrGroup != null) {
if (!systemHelper.isCrawlProcessRunning()) {
final CrawlTask crawlTask = SingletonS2Container
.getComponent(CrawlTask.class);
new Thread(new Runnable() {
@Override
public void run() {
systemHelper.updateStatus(solrGroup, QueryType.ADD);
crawlTask.doExecute();
}
}).start();
final ScheduledJobService scheduledJobService = SingletonS2Container
.getComponent(ScheduledJobService.class);
final List<ScheduledJob> scheduledJobList = scheduledJobService
.getCrawloerJobList();
for (final ScheduledJob scheduledJob : scheduledJobList) {
new Thread(new Runnable() {
@Override
public void run() {
new TriggeredJob().execute(scheduledJob);
}
}).start();
}
SAStrutsUtil.addSessionMessage("success.start_crawl_process");
} else {
SAStrutsUtil
@ -238,8 +244,9 @@ public class SystemAction implements Serializable {
@Execute(validator = true, input = "index")
public String stop() {
if (systemHelper.isCrawlProcessRunning()) {
systemHelper.destroyCrawlerProcess();
systemHelper.finishCrawlProcess();
for (final String sessionId : systemHelper.getRunningSessionIdSet()) {
systemHelper.destroyCrawlerProcess(sessionId);
}
SAStrutsUtil.addSessionMessage("success.stopping_crawl_process");
} else {
SAStrutsUtil.addSessionMessage("errors.no_running_crawl_process");
@ -305,12 +312,12 @@ public class SystemAction implements Serializable {
return solrInstanceList;
}
public boolean isSolrProcessRunning() {
public boolean isCrawlerRunning() {
return systemHelper.isCrawlProcessRunning();
}
public String getRunningSessionId() {
return systemHelper.getSessionId();
public Set<String> getRunningSessionIdSet() {
return systemHelper.getRunningSessionIdSet();
}
}

View file

@ -30,19 +30,20 @@ import jp.sf.fess.Constants;
import jp.sf.fess.crud.util.SAStrutsUtil;
import jp.sf.fess.db.exentity.BrowserType;
import jp.sf.fess.db.exentity.FileCrawlingConfig;
import jp.sf.fess.db.exentity.ScheduledJob;
import jp.sf.fess.db.exentity.WebCrawlingConfig;
import jp.sf.fess.form.admin.WizardForm;
import jp.sf.fess.helper.SystemHelper;
import jp.sf.fess.job.TriggeredJob;
import jp.sf.fess.service.BrowserTypeService;
import jp.sf.fess.service.FileCrawlingConfigService;
import jp.sf.fess.service.ScheduledJobService;
import jp.sf.fess.service.WebCrawlingConfigService;
import jp.sf.fess.task.CrawlTask;
import org.apache.commons.lang.StringUtils;
import org.codelibs.core.util.DynamicProperties;
import org.codelibs.sastruts.core.annotation.Token;
import org.codelibs.sastruts.core.exception.SSCActionMessagesException;
import org.seasar.chronos.core.trigger.cron.CronExpression;
import org.seasar.framework.container.SingletonS2Container;
import org.seasar.framework.util.StringUtil;
import org.seasar.robot.util.CharUtil;
@ -85,72 +86,6 @@ public class WizardAction implements Serializable {
return "index.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false)
public String scheduleForm() {
final String cronExpression = crawlerProperties.getProperty(
Constants.CRON_EXPRESSION_PROPERTY,
Constants.DEFAULT_CRON_EXPRESSION);
final String[] exps = cronExpression.split(" ");
if (exps.length > 5) {
if (exps.length > 6 && "1970".equals(exps[6])) {
wizardForm.scheduleEnabled = null;
} else {
wizardForm.scheduleEnabled = "on";
}
wizardForm.scheduleMin = exps[1];
wizardForm.scheduleHour = exps[2];
wizardForm.scheduleDate = exps[3];
wizardForm.scheduleMonth = exps[4];
wizardForm.scheduleDay = exps[5];
}
return "schedule.jsp";
}
@Token(save = false, validate = true)
@Execute(validator = true, input = "scheduleForm")
public String schedule() {
if ("on".equalsIgnoreCase(wizardForm.scheduleEnabled)) {
final StringBuilder buf = new StringBuilder();
buf.append("0 ");
buf.append(wizardForm.scheduleMin);
buf.append(' ');
buf.append(wizardForm.scheduleHour);
buf.append(' ');
if ("?".equals(wizardForm.scheduleDay)) {
buf.append(wizardForm.scheduleDate);
} else {
buf.append('?');
}
buf.append(' ');
buf.append(wizardForm.scheduleMonth);
buf.append(' ');
buf.append(wizardForm.scheduleDay);
final String cronExpression = buf.toString();
if (!CronExpression.isValidExpression(cronExpression)) {
throw new SSCActionMessagesException("errors.cronexpression",
cronExpression);
}
crawlerProperties.setProperty(Constants.CRON_EXPRESSION_PROPERTY,
cronExpression);
} else {
crawlerProperties.setProperty(Constants.CRON_EXPRESSION_PROPERTY,
"0 0 0 1 1 ? 1970");
}
try {
crawlerProperties.store();
SAStrutsUtil.addSessionMessage("success.update_crawler_schedule");
return "crawlingConfigForm?redirect=true";
} catch (final Exception e) {
logger.error("Failed to update crawler schedule.", e);
throw new SSCActionMessagesException(e,
"errors.failed_to_update_crawler_schedule");
}
}
@Token(save = true, validate = false)
@Execute(validator = false)
public String crawlingConfigForm() {
@ -390,14 +325,18 @@ public class WizardAction implements Serializable {
@Execute(validator = false)
public String startCrawling() {
if (!systemHelper.isCrawlProcessRunning()) {
final CrawlTask crawlTask = SingletonS2Container
.getComponent(CrawlTask.class);
new Thread(new Runnable() {
@Override
public void run() {
crawlTask.doExecute();
}
}).start();
final ScheduledJobService scheduledJobService = SingletonS2Container
.getComponent(ScheduledJobService.class);
final List<ScheduledJob> scheduledJobList = scheduledJobService
.getCrawloerJobList();
for (final ScheduledJob scheduledJob : scheduledJobList) {
new Thread(new Runnable() {
@Override
public void run() {
new TriggeredJob().execute(scheduledJob);
}
}).start();
}
SAStrutsUtil.addSessionMessage("success.start_crawl_process");
} else {
SAStrutsUtil

View file

@ -203,7 +203,7 @@ public class BsBrowserTypeAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
browserTypeForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsCrawlingSessionAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
crawlingSessionForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsDataCrawlingConfigAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
dataCrawlingConfigForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -202,7 +202,7 @@ public class BsFailureUrlAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
failureUrlForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -203,7 +203,7 @@ public class BsFavoriteLogAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
favoriteLogForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsFileAuthenticationAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
fileAuthenticationForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsFileCrawlingConfigAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
fileCrawlingConfigForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -0,0 +1,342 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.action.admin;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import jp.sf.fess.crud.CommonConstants;
import jp.sf.fess.crud.CrudMessageException;
import jp.sf.fess.crud.util.SAStrutsUtil;
import jp.sf.fess.db.exentity.JobLog;
import jp.sf.fess.form.admin.JobLogForm;
import jp.sf.fess.pager.JobLogPager;
import jp.sf.fess.service.JobLogService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelibs.sastruts.core.annotation.Token;
import org.seasar.framework.beans.util.Beans;
import org.seasar.framework.util.StringUtil;
import org.seasar.struts.annotation.ActionForm;
import org.seasar.struts.annotation.Execute;
import org.seasar.struts.exception.ActionMessagesException;
public class BsJobLogAction implements Serializable {
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(BsJobLogAction.class);
// for list
public List<JobLog> jobLogItems;
// for edit/confirm/delete
@ActionForm
@Resource
protected JobLogForm jobLogForm;
@Resource
protected JobLogService jobLogService;
@Resource
protected JobLogPager jobLogPager;
protected String displayList(final boolean redirect) {
// page navi
jobLogItems = jobLogService.getJobLogList(jobLogPager);
// restore from pager
Beans.copy(jobLogPager, jobLogForm.searchParams)
.excludes(CommonConstants.PAGER_CONVERSION_RULE)
.execute();
if (redirect) {
return "index?redirect=true";
} else {
return "index.jsp";
}
}
@Execute(validator = false, input = "error.jsp")
public String index() {
return displayList(false);
}
@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}")
public String list() {
// page navi
if (StringUtil.isNotBlank(jobLogForm.pageNumber)) {
try {
jobLogPager.setCurrentPageNumber(Integer
.parseInt(jobLogForm.pageNumber));
} catch (final NumberFormatException e) {
if (log.isDebugEnabled()) {
log.debug("Invalid value: " + jobLogForm.pageNumber, e);
}
}
}
return displayList(false);
}
@Execute(validator = false, input = "error.jsp")
public String search() {
Beans.copy(jobLogForm.searchParams, jobLogPager)
.excludes(CommonConstants.PAGER_CONVERSION_RULE)
.execute();
return displayList(false);
}
@Execute(validator = false, input = "error.jsp")
public String reset() {
jobLogPager.clear();
return displayList(false);
}
@Execute(validator = false, input = "error.jsp")
public String back() {
return displayList(false);
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String editagain() {
return "edit.jsp";
}
@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}")
public String confirmpage() {
if (jobLogForm.crudMode != CommonConstants.CONFIRM_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.CONFIRM_MODE,
jobLogForm.crudMode });
}
loadJobLog();
return "confirm.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String createpage() {
// page navi
jobLogForm.initialize();
jobLogForm.crudMode = CommonConstants.CREATE_MODE;
return "edit.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}")
public String editpage() {
if (jobLogForm.crudMode != CommonConstants.EDIT_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.EDIT_MODE,
jobLogForm.crudMode });
}
loadJobLog();
return "edit.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String editfromconfirm() {
jobLogForm.crudMode = CommonConstants.EDIT_MODE;
loadJobLog();
return "edit.jsp";
}
@Token(save = false, validate = true, keep = true)
@Execute(validator = true, input = "edit.jsp")
public String confirmfromcreate() {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Execute(validator = true, input = "edit.jsp")
public String confirmfromupdate() {
return "confirm.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}")
public String deletepage() {
if (jobLogForm.crudMode != CommonConstants.DELETE_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.DELETE_MODE,
jobLogForm.crudMode });
}
loadJobLog();
return "confirm.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
jobLogForm.crudMode = CommonConstants.DELETE_MODE;
loadJobLog();
return "confirm.jsp";
}
@Token(save = false, validate = true)
@Execute(validator = true, input = "edit.jsp")
public String create() {
try {
final JobLog jobLog = createJobLog();
jobLogService.store(jobLog);
SAStrutsUtil.addSessionMessage("success.crud_create_crud_table");
return displayList(true);
} catch (final ActionMessagesException e) {
log.error(e.getMessage(), e);
throw e;
} catch (final CrudMessageException e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(e.getMessageId(), e.getArgs());
} catch (final Exception e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(
"errors.crud_failed_to_create_crud_table");
}
}
@Token(save = false, validate = true)
@Execute(validator = true, input = "edit.jsp")
public String update() {
try {
final JobLog jobLog = createJobLog();
jobLogService.store(jobLog);
SAStrutsUtil.addSessionMessage("success.crud_update_crud_table");
return displayList(true);
} catch (final ActionMessagesException e) {
log.error(e.getMessage(), e);
throw e;
} catch (final CrudMessageException e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(e.getMessageId(), e.getArgs());
} catch (final Exception e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(
"errors.crud_failed_to_update_crud_table");
}
}
@Token(save = false, validate = true)
@Execute(validator = false, input = "error.jsp")
public String delete() {
if (jobLogForm.crudMode != CommonConstants.DELETE_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.DELETE_MODE,
jobLogForm.crudMode });
}
try {
final JobLog jobLog = jobLogService.getJobLog(createKeyMap());
if (jobLog == null) {
// throw an exception
throw new ActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { jobLogForm.id });
}
jobLogService.delete(jobLog);
SAStrutsUtil.addSessionMessage("success.crud_delete_crud_table");
return displayList(true);
} catch (final ActionMessagesException e) {
log.error(e.getMessage(), e);
throw e;
} catch (final CrudMessageException e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(e.getMessageId(), e.getArgs());
} catch (final Exception e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(
"errors.crud_failed_to_delete_crud_table");
}
}
protected void loadJobLog() {
final JobLog jobLog = jobLogService.getJobLog(createKeyMap());
if (jobLog == null) {
// throw an exception
throw new ActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { jobLogForm.id });
}
Beans.copy(jobLog, jobLogForm).excludes("searchParams", "mode")
.execute();
}
protected JobLog createJobLog() {
JobLog jobLog;
if (jobLogForm.crudMode == CommonConstants.EDIT_MODE) {
jobLog = jobLogService.getJobLog(createKeyMap());
if (jobLog == null) {
// throw an exception
throw new ActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { jobLogForm.id });
}
} else {
jobLog = new JobLog();
}
Beans.copy(jobLogForm, jobLog).excludes("searchParams", "mode")
.execute();
return jobLog;
}
protected Map<String, String> createKeyMap() {
final Map<String, String> keys = new HashMap<String, String>();
keys.put("id", jobLogForm.id);
return keys;
}
}

View file

@ -202,7 +202,7 @@ public class BsLabelTypeAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
labelTypeForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsOverlappingHostAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
overlappingHostForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -203,7 +203,7 @@ public class BsPathMappingAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
pathMappingForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsRequestHeaderAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
requestHeaderForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -202,7 +202,7 @@ public class BsRoleTypeAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
roleTypeForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -0,0 +1,349 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.action.admin;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import jp.sf.fess.crud.CommonConstants;
import jp.sf.fess.crud.CrudMessageException;
import jp.sf.fess.crud.util.SAStrutsUtil;
import jp.sf.fess.db.exentity.ScheduledJob;
import jp.sf.fess.form.admin.ScheduledJobForm;
import jp.sf.fess.pager.ScheduledJobPager;
import jp.sf.fess.service.ScheduledJobService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelibs.sastruts.core.annotation.Token;
import org.seasar.framework.beans.util.Beans;
import org.seasar.framework.util.StringUtil;
import org.seasar.struts.annotation.ActionForm;
import org.seasar.struts.annotation.Execute;
import org.seasar.struts.exception.ActionMessagesException;
public class BsScheduledJobAction implements Serializable {
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory
.getLog(BsScheduledJobAction.class);
// for list
public List<ScheduledJob> scheduledJobItems;
// for edit/confirm/delete
@ActionForm
@Resource
protected ScheduledJobForm scheduledJobForm;
@Resource
protected ScheduledJobService scheduledJobService;
@Resource
protected ScheduledJobPager scheduledJobPager;
protected String displayList(final boolean redirect) {
// page navi
scheduledJobItems = scheduledJobService
.getScheduledJobList(scheduledJobPager);
// restore from pager
Beans.copy(scheduledJobPager, scheduledJobForm.searchParams)
.excludes(CommonConstants.PAGER_CONVERSION_RULE)
.execute();
if (redirect) {
return "index?redirect=true";
} else {
return "index.jsp";
}
}
@Execute(validator = false, input = "error.jsp")
public String index() {
return displayList(false);
}
@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}")
public String list() {
// page navi
if (StringUtil.isNotBlank(scheduledJobForm.pageNumber)) {
try {
scheduledJobPager.setCurrentPageNumber(Integer
.parseInt(scheduledJobForm.pageNumber));
} catch (final NumberFormatException e) {
if (log.isDebugEnabled()) {
log.debug("Invalid value: " + scheduledJobForm.pageNumber,
e);
}
}
}
return displayList(false);
}
@Execute(validator = false, input = "error.jsp")
public String search() {
Beans.copy(scheduledJobForm.searchParams, scheduledJobPager)
.excludes(CommonConstants.PAGER_CONVERSION_RULE)
.execute();
return displayList(false);
}
@Execute(validator = false, input = "error.jsp")
public String reset() {
scheduledJobPager.clear();
return displayList(false);
}
@Execute(validator = false, input = "error.jsp")
public String back() {
return displayList(false);
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String editagain() {
return "edit.jsp";
}
@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}")
public String confirmpage() {
if (scheduledJobForm.crudMode != CommonConstants.CONFIRM_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.CONFIRM_MODE,
scheduledJobForm.crudMode });
}
loadScheduledJob();
return "confirm.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String createpage() {
// page navi
scheduledJobForm.initialize();
scheduledJobForm.crudMode = CommonConstants.CREATE_MODE;
return "edit.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}")
public String editpage() {
if (scheduledJobForm.crudMode != CommonConstants.EDIT_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.EDIT_MODE,
scheduledJobForm.crudMode });
}
loadScheduledJob();
return "edit.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String editfromconfirm() {
scheduledJobForm.crudMode = CommonConstants.EDIT_MODE;
loadScheduledJob();
return "edit.jsp";
}
@Token(save = false, validate = true, keep = true)
@Execute(validator = true, input = "edit.jsp")
public String confirmfromcreate() {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Execute(validator = true, input = "edit.jsp")
public String confirmfromupdate() {
return "confirm.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}")
public String deletepage() {
if (scheduledJobForm.crudMode != CommonConstants.DELETE_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.DELETE_MODE,
scheduledJobForm.crudMode });
}
loadScheduledJob();
return "confirm.jsp";
}
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
scheduledJobForm.crudMode = CommonConstants.DELETE_MODE;
loadScheduledJob();
return "confirm.jsp";
}
@Token(save = false, validate = true)
@Execute(validator = true, input = "edit.jsp")
public String create() {
try {
final ScheduledJob scheduledJob = createScheduledJob();
scheduledJobService.store(scheduledJob);
SAStrutsUtil.addSessionMessage("success.crud_create_crud_table");
return displayList(true);
} catch (final ActionMessagesException e) {
log.error(e.getMessage(), e);
throw e;
} catch (final CrudMessageException e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(e.getMessageId(), e.getArgs());
} catch (final Exception e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(
"errors.crud_failed_to_create_crud_table");
}
}
@Token(save = false, validate = true)
@Execute(validator = true, input = "edit.jsp")
public String update() {
try {
final ScheduledJob scheduledJob = createScheduledJob();
scheduledJobService.store(scheduledJob);
SAStrutsUtil.addSessionMessage("success.crud_update_crud_table");
return displayList(true);
} catch (final ActionMessagesException e) {
log.error(e.getMessage(), e);
throw e;
} catch (final CrudMessageException e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(e.getMessageId(), e.getArgs());
} catch (final Exception e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(
"errors.crud_failed_to_update_crud_table");
}
}
@Token(save = false, validate = true)
@Execute(validator = false, input = "error.jsp")
public String delete() {
if (scheduledJobForm.crudMode != CommonConstants.DELETE_MODE) {
throw new ActionMessagesException("errors.crud_invalid_mode",
new Object[] { CommonConstants.DELETE_MODE,
scheduledJobForm.crudMode });
}
try {
final ScheduledJob scheduledJob = scheduledJobService
.getScheduledJob(createKeyMap());
if (scheduledJob == null) {
// throw an exception
throw new ActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { scheduledJobForm.id });
}
scheduledJobService.delete(scheduledJob);
SAStrutsUtil.addSessionMessage("success.crud_delete_crud_table");
return displayList(true);
} catch (final ActionMessagesException e) {
log.error(e.getMessage(), e);
throw e;
} catch (final CrudMessageException e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(e.getMessageId(), e.getArgs());
} catch (final Exception e) {
log.error(e.getMessage(), e);
throw new ActionMessagesException(
"errors.crud_failed_to_delete_crud_table");
}
}
protected void loadScheduledJob() {
final ScheduledJob scheduledJob = scheduledJobService
.getScheduledJob(createKeyMap());
if (scheduledJob == null) {
// throw an exception
throw new ActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { scheduledJobForm.id });
}
Beans.copy(scheduledJob, scheduledJobForm)
.excludes("searchParams", "mode")
.execute();
}
protected ScheduledJob createScheduledJob() {
ScheduledJob scheduledJob;
if (scheduledJobForm.crudMode == CommonConstants.EDIT_MODE) {
scheduledJob = scheduledJobService.getScheduledJob(createKeyMap());
if (scheduledJob == null) {
// throw an exception
throw new ActionMessagesException(
"errors.crud_could_not_find_crud_table",
new Object[] { scheduledJobForm.id });
}
} else {
scheduledJob = new ScheduledJob();
}
Beans.copy(scheduledJobForm, scheduledJob)
.excludes("searchParams", "mode")
.execute();
return scheduledJob;
}
protected Map<String, String> createKeyMap() {
final Map<String, String> keys = new HashMap<String, String>();
keys.put("id", scheduledJobForm.id);
return keys;
}
}

View file

@ -202,7 +202,7 @@ public class BsSearchLogAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
searchLogForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -203,7 +203,7 @@ public class BsUserInfoAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
userInfoForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsWebAuthenticationAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
webAuthenticationForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -205,7 +205,7 @@ public class BsWebCrawlingConfigAction implements Serializable {
return "confirm.jsp";
}
@Token(save = false, validate = true, keep = true)
@Token(save = true, validate = false)
@Execute(validator = false, input = "error.jsp")
public String deletefromconfirm() {
webCrawlingConfigForm.crudMode = CommonConstants.DELETE_MODE;

View file

@ -0,0 +1,84 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.form.admin;
import java.util.HashMap;
import java.util.Map;
import jp.sf.fess.Constants;
import org.seasar.struts.annotation.DateType;
import org.seasar.struts.annotation.IntegerType;
import org.seasar.struts.annotation.LongType;
import org.seasar.struts.annotation.Required;
public abstract class BsJobLogForm {
@IntegerType
public String pageNumber;
public Map<String, String> searchParams = new HashMap<String, String>();
@IntegerType
public int crudMode;
public String getCurrentPageNumber() {
return pageNumber;
}
@Required(target = "confirmfromupdate,update,delete")
@LongType
public String id;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
public String jobName;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
public String jobStatus;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
public String target;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
public String scriptType;
public String scriptData;
public String scriptResult;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
public String startTime;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
public String endTime;
public void initialize() {
id = null;
jobName = null;
jobStatus = null;
target = null;
scriptType = null;
scriptData = null;
scriptResult = null;
startTime = null;
endTime = null;
}
}

View file

@ -0,0 +1,122 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.form.admin;
import java.util.HashMap;
import java.util.Map;
import jp.sf.fess.Constants;
import jp.sf.fess.annotation.CronExpression;
import org.seasar.struts.annotation.DateType;
import org.seasar.struts.annotation.IntRange;
import org.seasar.struts.annotation.IntegerType;
import org.seasar.struts.annotation.LongType;
import org.seasar.struts.annotation.Maxbytelength;
import org.seasar.struts.annotation.Required;
public abstract class BsScheduledJobForm {
@IntegerType
public String pageNumber;
public Map<String, String> searchParams = new HashMap<String, String>();
@IntegerType
public int crudMode;
public String getCurrentPageNumber() {
return pageNumber;
}
@Required(target = "confirmfromupdate,update,delete")
@LongType
public String id;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
@Maxbytelength(maxbytelength = 100)
public String name;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
@Maxbytelength(maxbytelength = 100)
public String target;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
@Maxbytelength(maxbytelength = 100)
@CronExpression
public String cronExpression;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
@Maxbytelength(maxbytelength = 100)
public String scriptType;
@Maxbytelength(maxbytelength = 4000)
public String scriptData;
// ignore
public String crawler;
// ignore
public String jobLogging;
@Required(target = "confirmfromcreate,create,confirmfromupdate,update,delete")
@IntegerType
@IntRange(min = 0, max = 2147483647)
public String sortOrder;
@Required(target = "confirmfromupdate,update,delete")
public String createdBy;
@Required(target = "confirmfromupdate,update,delete")
@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
public String createdTime;
public String updatedBy;
@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
public String updatedTime;
public String deletedBy;
@DateType(datePattern = Constants.DEFAULT_DATETIME_FORMAT)
public String deletedTime;
@Required(target = "confirmfromupdate,update,delete")
@IntegerType
public String versionNo;
public void initialize() {
id = null;
name = null;
target = null;
cronExpression = null;
scriptType = null;
scriptData = null;
crawler = null;
jobLogging = null;
sortOrder = null;
createdBy = null;
createdTime = null;
updatedBy = null;
updatedTime = null;
deletedBy = null;
deletedTime = null;
versionNo = null;
}
}

View file

@ -0,0 +1,140 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.pager;
import java.io.Serializable;
import java.util.List;
public abstract class BsJobLogPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1;
private int allRecordCount;
private int allPageCount;
private boolean existPrePage;
private boolean existNextPage;
private List<Integer> pageNumberList;
private int pageSize;
private int currentPageNumber;
public String id;
public String jobName;
public String jobStatus;
public String target;
public String scriptType;
public String startTime;
public String endTime;
public void clear() {
pageSize = getDefaultPageSize();
currentPageNumber = getDefaultCurrentPageNumber();
id = null;
jobName = null;
jobStatus = null;
target = null;
scriptType = null;
startTime = null;
endTime = null;
}
protected int getDefaultPageSize() {
return DEFAULT_PAGE_SIZE;
}
protected int getDefaultCurrentPageNumber() {
return DEFAULT_CURRENT_PAGE_NUMBER;
}
public int getAllRecordCount() {
return allRecordCount;
}
public void setAllRecordCount(final int allRecordCount) {
this.allRecordCount = allRecordCount;
}
public int getAllPageCount() {
return allPageCount;
}
public void setAllPageCount(final int allPageCount) {
this.allPageCount = allPageCount;
}
public boolean isExistPrePage() {
return existPrePage;
}
public void setExistPrePage(final boolean existPrePage) {
this.existPrePage = existPrePage;
}
public boolean isExistNextPage() {
return existNextPage;
}
public void setExistNextPage(final boolean existNextPage) {
this.existNextPage = existNextPage;
}
public int getPageSize() {
if (pageSize <= 0) {
pageSize = getDefaultPageSize();
}
return pageSize;
}
public void setPageSize(final int pageSize) {
this.pageSize = pageSize;
}
public int getCurrentPageNumber() {
if (currentPageNumber <= 0) {
currentPageNumber = getDefaultCurrentPageNumber();
}
return currentPageNumber;
}
public void setCurrentPageNumber(final int currentPageNumber) {
this.currentPageNumber = currentPageNumber;
}
public List<Integer> getPageNumberList() {
return pageNumberList;
}
public void setPageNumberList(final List<Integer> pageNumberList) {
this.pageNumberList = pageNumberList;
}
}

View file

@ -0,0 +1,152 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.pager;
import java.io.Serializable;
import java.util.List;
public abstract class BsScheduledJobPager implements Serializable {
private static final long serialVersionUID = 1L;
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1;
private int allRecordCount;
private int allPageCount;
private boolean existPrePage;
private boolean existNextPage;
private List<Integer> pageNumberList;
private int pageSize;
private int currentPageNumber;
public String id;
public String name;
public String target;
public String cronExpression;
public String scriptType;
public String crawler;
public String jobLogging;
public String sortOrder;
public String createdBy;
public String createdTime;
public String versionNo;
public void clear() {
pageSize = getDefaultPageSize();
currentPageNumber = getDefaultCurrentPageNumber();
id = null;
name = null;
target = null;
cronExpression = null;
scriptType = null;
crawler = null;
jobLogging = null;
sortOrder = null;
createdBy = null;
createdTime = null;
versionNo = null;
}
protected int getDefaultPageSize() {
return DEFAULT_PAGE_SIZE;
}
protected int getDefaultCurrentPageNumber() {
return DEFAULT_CURRENT_PAGE_NUMBER;
}
public int getAllRecordCount() {
return allRecordCount;
}
public void setAllRecordCount(final int allRecordCount) {
this.allRecordCount = allRecordCount;
}
public int getAllPageCount() {
return allPageCount;
}
public void setAllPageCount(final int allPageCount) {
this.allPageCount = allPageCount;
}
public boolean isExistPrePage() {
return existPrePage;
}
public void setExistPrePage(final boolean existPrePage) {
this.existPrePage = existPrePage;
}
public boolean isExistNextPage() {
return existNextPage;
}
public void setExistNextPage(final boolean existNextPage) {
this.existNextPage = existNextPage;
}
public int getPageSize() {
if (pageSize <= 0) {
pageSize = getDefaultPageSize();
}
return pageSize;
}
public void setPageSize(final int pageSize) {
this.pageSize = pageSize;
}
public int getCurrentPageNumber() {
if (currentPageNumber <= 0) {
currentPageNumber = getDefaultCurrentPageNumber();
}
return currentPageNumber;
}
public void setCurrentPageNumber(final int currentPageNumber) {
this.currentPageNumber = currentPageNumber;
}
public List<Integer> getPageNumberList() {
return pageNumberList;
}
public void setPageNumberList(final List<Integer> pageNumberList) {
this.pageNumberList = pageNumberList;
}
}

View file

@ -0,0 +1,113 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.service;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import jp.sf.fess.crud.CommonConstants;
import jp.sf.fess.crud.CrudMessageException;
import jp.sf.fess.db.cbean.JobLogCB;
import jp.sf.fess.db.exbhv.JobLogBhv;
import jp.sf.fess.db.exentity.JobLog;
import jp.sf.fess.pager.JobLogPager;
import org.seasar.dbflute.cbean.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public abstract class BsJobLogService {
@Resource
protected JobLogBhv jobLogBhv;
public BsJobLogService() {
super();
}
public List<JobLog> getJobLogList(final JobLogPager jobLogPager) {
final JobLogCB cb = new JobLogCB();
cb.fetchFirst(jobLogPager.getPageSize());
cb.fetchPage(jobLogPager.getCurrentPageNumber());
setupListCondition(cb, jobLogPager);
final PagingResultBean<JobLog> jobLogList = jobLogBhv.selectPage(cb);
// update pager
Beans.copy(jobLogList, jobLogPager)
.includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
jobLogList.setPageRangeSize(5);
jobLogPager.setPageNumberList(jobLogList.pageRange()
.createPageNumberList());
return jobLogList;
}
public JobLog getJobLog(final Map<String, String> keys) {
final JobLogCB cb = new JobLogCB();
cb.query().setId_Equal(Long.parseLong(keys.get("id")));
// TODO Long, Integer, String supported only.
setupEntityCondition(cb, keys);
final JobLog jobLog = jobLogBhv.selectEntity(cb);
if (jobLog == null) {
// TODO exception?
return null;
}
return jobLog;
}
public void store(final JobLog jobLog) throws CrudMessageException {
setupStoreCondition(jobLog);
jobLogBhv.insertOrUpdate(jobLog);
}
public void delete(final JobLog jobLog) throws CrudMessageException {
setupDeleteCondition(jobLog);
jobLogBhv.delete(jobLog);
}
protected void setupListCondition(final JobLogCB cb,
final JobLogPager jobLogPager) {
if (jobLogPager.id != null) {
cb.query().setId_Equal(Long.parseLong(jobLogPager.id));
}
// TODO Long, Integer, String supported only.
}
protected void setupEntityCondition(final JobLogCB cb,
final Map<String, String> keys) {
}
protected void setupStoreCondition(final JobLog jobLog) {
}
protected void setupDeleteCondition(final JobLog jobLog) {
}
}

View file

@ -0,0 +1,117 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.crud.service;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import jp.sf.fess.crud.CommonConstants;
import jp.sf.fess.crud.CrudMessageException;
import jp.sf.fess.db.cbean.ScheduledJobCB;
import jp.sf.fess.db.exbhv.ScheduledJobBhv;
import jp.sf.fess.db.exentity.ScheduledJob;
import jp.sf.fess.pager.ScheduledJobPager;
import org.seasar.dbflute.cbean.PagingResultBean;
import org.seasar.framework.beans.util.Beans;
public abstract class BsScheduledJobService {
@Resource
protected ScheduledJobBhv scheduledJobBhv;
public BsScheduledJobService() {
super();
}
public List<ScheduledJob> getScheduledJobList(
final ScheduledJobPager scheduledJobPager) {
final ScheduledJobCB cb = new ScheduledJobCB();
cb.fetchFirst(scheduledJobPager.getPageSize());
cb.fetchPage(scheduledJobPager.getCurrentPageNumber());
setupListCondition(cb, scheduledJobPager);
final PagingResultBean<ScheduledJob> scheduledJobList = scheduledJobBhv
.selectPage(cb);
// update pager
Beans.copy(scheduledJobList, scheduledJobPager)
.includes(CommonConstants.PAGER_CONVERSION_RULE).execute();
scheduledJobList.setPageRangeSize(5);
scheduledJobPager.setPageNumberList(scheduledJobList.pageRange()
.createPageNumberList());
return scheduledJobList;
}
public ScheduledJob getScheduledJob(final Map<String, String> keys) {
final ScheduledJobCB cb = new ScheduledJobCB();
cb.query().setId_Equal(Long.parseLong(keys.get("id")));
// TODO Long, Integer, String supported only.
setupEntityCondition(cb, keys);
final ScheduledJob scheduledJob = scheduledJobBhv.selectEntity(cb);
if (scheduledJob == null) {
// TODO exception?
return null;
}
return scheduledJob;
}
public void store(final ScheduledJob scheduledJob)
throws CrudMessageException {
setupStoreCondition(scheduledJob);
scheduledJobBhv.insertOrUpdate(scheduledJob);
}
public void delete(final ScheduledJob scheduledJob)
throws CrudMessageException {
setupDeleteCondition(scheduledJob);
scheduledJobBhv.delete(scheduledJob);
}
protected void setupListCondition(final ScheduledJobCB cb,
final ScheduledJobPager scheduledJobPager) {
if (scheduledJobPager.id != null) {
cb.query().setId_Equal(Long.parseLong(scheduledJobPager.id));
}
// TODO Long, Integer, String supported only.
}
protected void setupEntityCondition(final ScheduledJobCB cb,
final Map<String, String> keys) {
}
protected void setupStoreCondition(final ScheduledJob scheduledJob) {
}
protected void setupDeleteCondition(final ScheduledJob scheduledJob) {
}
}

View file

@ -76,6 +76,7 @@ public class DBMetaInstanceHandler implements DBMetaProvider {
"jp.sf.fess.db.bsentity.dbmeta.FileConfigToRoleTypeMappingDbm");
tmpMap.put("FILE_CRAWLING_CONFIG",
"jp.sf.fess.db.bsentity.dbmeta.FileCrawlingConfigDbm");
tmpMap.put("JOB_LOG", "jp.sf.fess.db.bsentity.dbmeta.JobLogDbm");
tmpMap.put("LABEL_TYPE", "jp.sf.fess.db.bsentity.dbmeta.LabelTypeDbm");
tmpMap.put("LABEL_TYPE_TO_ROLE_TYPE_MAPPING",
"jp.sf.fess.db.bsentity.dbmeta.LabelTypeToRoleTypeMappingDbm");
@ -86,6 +87,8 @@ public class DBMetaInstanceHandler implements DBMetaProvider {
tmpMap.put("REQUEST_HEADER",
"jp.sf.fess.db.bsentity.dbmeta.RequestHeaderDbm");
tmpMap.put("ROLE_TYPE", "jp.sf.fess.db.bsentity.dbmeta.RoleTypeDbm");
tmpMap.put("SCHEDULED_JOB",
"jp.sf.fess.db.bsentity.dbmeta.ScheduledJobDbm");
tmpMap.put("SEARCH_FIELD_LOG",
"jp.sf.fess.db.bsentity.dbmeta.SearchFieldLogDbm");
tmpMap.put("SEARCH_LOG", "jp.sf.fess.db.bsentity.dbmeta.SearchLogDbm");

View file

@ -1085,7 +1085,9 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param browserType The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1140,7 +1142,9 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param browserType The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1315,8 +1319,8 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param browserTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1346,13 +1350,14 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* browserTypeBhv.<span style="color: #FD4747">batchUpdate</span>(browserTypeList, new SpecifyQuery<BrowserTypeCB>() {
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1367,10 +1372,23 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<BrowserType> browserTypeList,
final UpdateOption<BrowserTypeCB> option) {
assertObjectNotNull("browserTypeList", browserTypeList);
prepareUpdateOption(option);
prepareBatchUpdateOption(browserTypeList, option);
return delegateBatchUpdate(browserTypeList, option);
}
protected void prepareBatchUpdateOption(
final List<BrowserType> browserTypeList,
final UpdateOption<BrowserTypeCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(browserTypeList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1383,18 +1401,27 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* browserTypeBhv.<span style="color: #FD4747">batchUpdate</span>(browserTypeList, new SpecifyQuery<BrowserTypeCB>() {
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* browserTypeBhv.<span style="color: #FD4747">batchUpdate</span>(browserTypeList, new SpecifyQuery<BrowserTypeCB>() {
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param browserTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1410,12 +1437,13 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* browserTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(browserTypeList, new SpecifyQuery<BrowserTypeCB>() {
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1431,24 +1459,32 @@ public abstract class BsBrowserTypeBhv extends AbstractBehaviorWritable {
final List<BrowserType> browserTypeList,
final UpdateOption<BrowserTypeCB> option) {
assertObjectNotNull("browserTypeList", browserTypeList);
prepareUpdateOption(option);
prepareBatchUpdateOption(browserTypeList, option);
return delegateBatchUpdateNonstrict(browserTypeList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* browserTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(browserTypeList, new SpecifyQuery<BrowserTypeCB>() {
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* browserTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(browserTypeList, new SpecifyQuery<BrowserTypeCB>() {
* public void specify(BrowserTypeCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param browserTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -640,7 +640,9 @@ public abstract class BsClickLogBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param clickLog The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -761,8 +763,8 @@ public abstract class BsClickLogBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param clickLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -792,13 +794,14 @@ public abstract class BsClickLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* clickLogBhv.<span style="color: #FD4747">batchUpdate</span>(clickLogList, new SpecifyQuery<ClickLogCB>() {
* public void specify(ClickLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(ClickLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -813,10 +816,22 @@ public abstract class BsClickLogBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<ClickLog> clickLogList,
final UpdateOption<ClickLogCB> option) {
assertObjectNotNull("clickLogList", clickLogList);
prepareUpdateOption(option);
prepareBatchUpdateOption(clickLogList, option);
return delegateBatchUpdate(clickLogList, option);
}
protected void prepareBatchUpdateOption(final List<ClickLog> clickLogList,
final UpdateOption<ClickLogCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(clickLogList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -829,18 +844,27 @@ public abstract class BsClickLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* clickLogBhv.<span style="color: #FD4747">batchUpdate</span>(clickLogList, new SpecifyQuery<ClickLogCB>() {
* public void specify(ClickLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(ClickLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* clickLogBhv.<span style="color: #FD4747">batchUpdate</span>(clickLogList, new SpecifyQuery<ClickLogCB>() {
* public void specify(ClickLogCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param clickLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -768,7 +768,9 @@ public abstract class BsCrawlingSessionBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param crawlingSession The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -893,8 +895,8 @@ public abstract class BsCrawlingSessionBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param crawlingSessionList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -925,13 +927,14 @@ public abstract class BsCrawlingSessionBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* crawlingSessionBhv.<span style="color: #FD4747">batchUpdate</span>(crawlingSessionList, new SpecifyQuery<CrawlingSessionCB>() {
* public void specify(CrawlingSessionCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(CrawlingSessionCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -947,10 +950,23 @@ public abstract class BsCrawlingSessionBhv extends AbstractBehaviorWritable {
final List<CrawlingSession> crawlingSessionList,
final UpdateOption<CrawlingSessionCB> option) {
assertObjectNotNull("crawlingSessionList", crawlingSessionList);
prepareUpdateOption(option);
prepareBatchUpdateOption(crawlingSessionList, option);
return delegateBatchUpdate(crawlingSessionList, option);
}
protected void prepareBatchUpdateOption(
final List<CrawlingSession> crawlingSessionList,
final UpdateOption<CrawlingSessionCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(crawlingSessionList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -963,18 +979,27 @@ public abstract class BsCrawlingSessionBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* crawlingSessionBhv.<span style="color: #FD4747">batchUpdate</span>(crawlingSessionList, new SpecifyQuery<CrawlingSessionCB>() {
* public void specify(CrawlingSessionCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(CrawlingSessionCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* crawlingSessionBhv.<span style="color: #FD4747">batchUpdate</span>(crawlingSessionList, new SpecifyQuery<CrawlingSessionCB>() {
* public void specify(CrawlingSessionCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param crawlingSessionList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -665,7 +665,9 @@ public abstract class BsCrawlingSessionInfoBhv extends AbstractBehaviorWritable
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param crawlingSessionInfo The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -792,8 +794,8 @@ public abstract class BsCrawlingSessionInfoBhv extends AbstractBehaviorWritable
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param crawlingSessionInfoList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -825,13 +827,14 @@ public abstract class BsCrawlingSessionInfoBhv extends AbstractBehaviorWritable
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* crawlingSessionInfoBhv.<span style="color: #FD4747">batchUpdate</span>(crawlingSessionInfoList, new SpecifyQuery<CrawlingSessionInfoCB>() {
* public void specify(CrawlingSessionInfoCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(CrawlingSessionInfoCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -848,10 +851,23 @@ public abstract class BsCrawlingSessionInfoBhv extends AbstractBehaviorWritable
final List<CrawlingSessionInfo> crawlingSessionInfoList,
final UpdateOption<CrawlingSessionInfoCB> option) {
assertObjectNotNull("crawlingSessionInfoList", crawlingSessionInfoList);
prepareUpdateOption(option);
prepareBatchUpdateOption(crawlingSessionInfoList, option);
return delegateBatchUpdate(crawlingSessionInfoList, option);
}
protected void prepareBatchUpdateOption(
final List<CrawlingSessionInfo> crawlingSessionInfoList,
final UpdateOption<CrawlingSessionInfoCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(crawlingSessionInfoList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -864,18 +880,27 @@ public abstract class BsCrawlingSessionInfoBhv extends AbstractBehaviorWritable
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* crawlingSessionInfoBhv.<span style="color: #FD4747">batchUpdate</span>(crawlingSessionInfoList, new SpecifyQuery<CrawlingSessionInfoCB>() {
* public void specify(CrawlingSessionInfoCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(CrawlingSessionInfoCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* crawlingSessionInfoBhv.<span style="color: #FD4747">batchUpdate</span>(crawlingSessionInfoList, new SpecifyQuery<CrawlingSessionInfoCB>() {
* public void specify(CrawlingSessionInfoCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param crawlingSessionInfoList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -715,7 +715,9 @@ public abstract class BsDataConfigToBrowserTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param dataConfigToBrowserTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -848,8 +850,8 @@ public abstract class BsDataConfigToBrowserTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param dataConfigToBrowserTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -882,13 +884,14 @@ public abstract class BsDataConfigToBrowserTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* dataConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToBrowserTypeMappingList, new SpecifyQuery<DataConfigToBrowserTypeMappingCB>() {
* public void specify(DataConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -906,10 +909,23 @@ public abstract class BsDataConfigToBrowserTypeMappingBhv extends
final UpdateOption<DataConfigToBrowserTypeMappingCB> option) {
assertObjectNotNull("dataConfigToBrowserTypeMappingList",
dataConfigToBrowserTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(dataConfigToBrowserTypeMappingList, option);
return delegateBatchUpdate(dataConfigToBrowserTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<DataConfigToBrowserTypeMapping> dataConfigToBrowserTypeMappingList,
final UpdateOption<DataConfigToBrowserTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(dataConfigToBrowserTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -922,18 +938,27 @@ public abstract class BsDataConfigToBrowserTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* dataConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToBrowserTypeMappingList, new SpecifyQuery<DataConfigToBrowserTypeMappingCB>() {
* public void specify(DataConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* dataConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToBrowserTypeMappingList, new SpecifyQuery<DataConfigToBrowserTypeMappingCB>() {
* public void specify(DataConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param dataConfigToBrowserTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -712,7 +712,9 @@ public abstract class BsDataConfigToLabelTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param dataConfigToLabelTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -845,8 +847,8 @@ public abstract class BsDataConfigToLabelTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param dataConfigToLabelTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -879,13 +881,14 @@ public abstract class BsDataConfigToLabelTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* dataConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToLabelTypeMappingList, new SpecifyQuery<DataConfigToLabelTypeMappingCB>() {
* public void specify(DataConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -903,10 +906,23 @@ public abstract class BsDataConfigToLabelTypeMappingBhv extends
final UpdateOption<DataConfigToLabelTypeMappingCB> option) {
assertObjectNotNull("dataConfigToLabelTypeMappingList",
dataConfigToLabelTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(dataConfigToLabelTypeMappingList, option);
return delegateBatchUpdate(dataConfigToLabelTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<DataConfigToLabelTypeMapping> dataConfigToLabelTypeMappingList,
final UpdateOption<DataConfigToLabelTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(dataConfigToLabelTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -919,18 +935,27 @@ public abstract class BsDataConfigToLabelTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* dataConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToLabelTypeMappingList, new SpecifyQuery<DataConfigToLabelTypeMappingCB>() {
* public void specify(DataConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* dataConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToLabelTypeMappingList, new SpecifyQuery<DataConfigToLabelTypeMappingCB>() {
* public void specify(DataConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param dataConfigToLabelTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -711,7 +711,9 @@ public abstract class BsDataConfigToRoleTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param dataConfigToRoleTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -844,8 +846,8 @@ public abstract class BsDataConfigToRoleTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param dataConfigToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -878,13 +880,14 @@ public abstract class BsDataConfigToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* dataConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToRoleTypeMappingList, new SpecifyQuery<DataConfigToRoleTypeMappingCB>() {
* public void specify(DataConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -902,10 +905,23 @@ public abstract class BsDataConfigToRoleTypeMappingBhv extends
final UpdateOption<DataConfigToRoleTypeMappingCB> option) {
assertObjectNotNull("dataConfigToRoleTypeMappingList",
dataConfigToRoleTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(dataConfigToRoleTypeMappingList, option);
return delegateBatchUpdate(dataConfigToRoleTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<DataConfigToRoleTypeMapping> dataConfigToRoleTypeMappingList,
final UpdateOption<DataConfigToRoleTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(dataConfigToRoleTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -918,18 +934,27 @@ public abstract class BsDataConfigToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* dataConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToRoleTypeMappingList, new SpecifyQuery<DataConfigToRoleTypeMappingCB>() {
* public void specify(DataConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* dataConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(dataConfigToRoleTypeMappingList, new SpecifyQuery<DataConfigToRoleTypeMappingCB>() {
* public void specify(DataConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param dataConfigToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -1095,7 +1095,9 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param dataCrawlingConfig The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1151,7 +1153,9 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param dataCrawlingConfig The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1334,8 +1338,8 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param dataCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1367,13 +1371,14 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* dataCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(dataCrawlingConfigList, new SpecifyQuery<DataCrawlingConfigCB>() {
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1390,10 +1395,23 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
final List<DataCrawlingConfig> dataCrawlingConfigList,
final UpdateOption<DataCrawlingConfigCB> option) {
assertObjectNotNull("dataCrawlingConfigList", dataCrawlingConfigList);
prepareUpdateOption(option);
prepareBatchUpdateOption(dataCrawlingConfigList, option);
return delegateBatchUpdate(dataCrawlingConfigList, option);
}
protected void prepareBatchUpdateOption(
final List<DataCrawlingConfig> dataCrawlingConfigList,
final UpdateOption<DataCrawlingConfigCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(dataCrawlingConfigList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1406,18 +1424,27 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* dataCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(dataCrawlingConfigList, new SpecifyQuery<DataCrawlingConfigCB>() {
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* dataCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(dataCrawlingConfigList, new SpecifyQuery<DataCrawlingConfigCB>() {
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param dataCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1434,12 +1461,13 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* dataCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(dataCrawlingConfigList, new SpecifyQuery<DataCrawlingConfigCB>() {
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1456,24 +1484,32 @@ public abstract class BsDataCrawlingConfigBhv extends AbstractBehaviorWritable {
final List<DataCrawlingConfig> dataCrawlingConfigList,
final UpdateOption<DataCrawlingConfigCB> option) {
assertObjectNotNull("dataCrawlingConfigList", dataCrawlingConfigList);
prepareUpdateOption(option);
prepareBatchUpdateOption(dataCrawlingConfigList, option);
return delegateBatchUpdateNonstrict(dataCrawlingConfigList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* dataCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(dataCrawlingConfigList, new SpecifyQuery<DataCrawlingConfigCB>() {
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* dataCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(dataCrawlingConfigList, new SpecifyQuery<DataCrawlingConfigCB>() {
* public void specify(DataCrawlingConfigCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param dataCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -673,7 +673,9 @@ public abstract class BsFailureUrlBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param failureUrl The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -795,8 +797,8 @@ public abstract class BsFailureUrlBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param failureUrlList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -826,13 +828,14 @@ public abstract class BsFailureUrlBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* failureUrlBhv.<span style="color: #FD4747">batchUpdate</span>(failureUrlList, new SpecifyQuery<FailureUrlCB>() {
* public void specify(FailureUrlCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FailureUrlCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -847,10 +850,23 @@ public abstract class BsFailureUrlBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<FailureUrl> failureUrlList,
final UpdateOption<FailureUrlCB> option) {
assertObjectNotNull("failureUrlList", failureUrlList);
prepareUpdateOption(option);
prepareBatchUpdateOption(failureUrlList, option);
return delegateBatchUpdate(failureUrlList, option);
}
protected void prepareBatchUpdateOption(
final List<FailureUrl> failureUrlList,
final UpdateOption<FailureUrlCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(failureUrlList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -863,18 +879,27 @@ public abstract class BsFailureUrlBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* failureUrlBhv.<span style="color: #FD4747">batchUpdate</span>(failureUrlList, new SpecifyQuery<FailureUrlCB>() {
* public void specify(FailureUrlCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FailureUrlCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* failureUrlBhv.<span style="color: #FD4747">batchUpdate</span>(failureUrlList, new SpecifyQuery<FailureUrlCB>() {
* public void specify(FailureUrlCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param failureUrlList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -649,7 +649,9 @@ public abstract class BsFavoriteLogBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param favoriteLog The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -772,8 +774,8 @@ public abstract class BsFavoriteLogBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param favoriteLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -803,13 +805,14 @@ public abstract class BsFavoriteLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* favoriteLogBhv.<span style="color: #FD4747">batchUpdate</span>(favoriteLogList, new SpecifyQuery<FavoriteLogCB>() {
* public void specify(FavoriteLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FavoriteLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -824,10 +827,23 @@ public abstract class BsFavoriteLogBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<FavoriteLog> favoriteLogList,
final UpdateOption<FavoriteLogCB> option) {
assertObjectNotNull("favoriteLogList", favoriteLogList);
prepareUpdateOption(option);
prepareBatchUpdateOption(favoriteLogList, option);
return delegateBatchUpdate(favoriteLogList, option);
}
protected void prepareBatchUpdateOption(
final List<FavoriteLog> favoriteLogList,
final UpdateOption<FavoriteLogCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(favoriteLogList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -840,18 +856,27 @@ public abstract class BsFavoriteLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* favoriteLogBhv.<span style="color: #FD4747">batchUpdate</span>(favoriteLogList, new SpecifyQuery<FavoriteLogCB>() {
* public void specify(FavoriteLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FavoriteLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* favoriteLogBhv.<span style="color: #FD4747">batchUpdate</span>(favoriteLogList, new SpecifyQuery<FavoriteLogCB>() {
* public void specify(FavoriteLogCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param favoriteLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -702,7 +702,9 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param fileAuthentication The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -758,7 +760,9 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param fileAuthentication The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -941,8 +945,8 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param fileAuthenticationList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -974,13 +978,14 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* fileAuthenticationBhv.<span style="color: #FD4747">batchUpdate</span>(fileAuthenticationList, new SpecifyQuery<FileAuthenticationCB>() {
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -997,10 +1002,23 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
final List<FileAuthentication> fileAuthenticationList,
final UpdateOption<FileAuthenticationCB> option) {
assertObjectNotNull("fileAuthenticationList", fileAuthenticationList);
prepareUpdateOption(option);
prepareBatchUpdateOption(fileAuthenticationList, option);
return delegateBatchUpdate(fileAuthenticationList, option);
}
protected void prepareBatchUpdateOption(
final List<FileAuthentication> fileAuthenticationList,
final UpdateOption<FileAuthenticationCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(fileAuthenticationList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1013,18 +1031,27 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* fileAuthenticationBhv.<span style="color: #FD4747">batchUpdate</span>(fileAuthenticationList, new SpecifyQuery<FileAuthenticationCB>() {
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* fileAuthenticationBhv.<span style="color: #FD4747">batchUpdate</span>(fileAuthenticationList, new SpecifyQuery<FileAuthenticationCB>() {
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param fileAuthenticationList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1041,12 +1068,13 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* fileAuthenticationBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(fileAuthenticationList, new SpecifyQuery<FileAuthenticationCB>() {
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1063,24 +1091,32 @@ public abstract class BsFileAuthenticationBhv extends AbstractBehaviorWritable {
final List<FileAuthentication> fileAuthenticationList,
final UpdateOption<FileAuthenticationCB> option) {
assertObjectNotNull("fileAuthenticationList", fileAuthenticationList);
prepareUpdateOption(option);
prepareBatchUpdateOption(fileAuthenticationList, option);
return delegateBatchUpdateNonstrict(fileAuthenticationList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* fileAuthenticationBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(fileAuthenticationList, new SpecifyQuery<FileAuthenticationCB>() {
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* fileAuthenticationBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(fileAuthenticationList, new SpecifyQuery<FileAuthenticationCB>() {
* public void specify(FileAuthenticationCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param fileAuthenticationList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -715,7 +715,9 @@ public abstract class BsFileConfigToBrowserTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param fileConfigToBrowserTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -848,8 +850,8 @@ public abstract class BsFileConfigToBrowserTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param fileConfigToBrowserTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -882,13 +884,14 @@ public abstract class BsFileConfigToBrowserTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* fileConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToBrowserTypeMappingList, new SpecifyQuery<FileConfigToBrowserTypeMappingCB>() {
* public void specify(FileConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -906,10 +909,23 @@ public abstract class BsFileConfigToBrowserTypeMappingBhv extends
final UpdateOption<FileConfigToBrowserTypeMappingCB> option) {
assertObjectNotNull("fileConfigToBrowserTypeMappingList",
fileConfigToBrowserTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(fileConfigToBrowserTypeMappingList, option);
return delegateBatchUpdate(fileConfigToBrowserTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<FileConfigToBrowserTypeMapping> fileConfigToBrowserTypeMappingList,
final UpdateOption<FileConfigToBrowserTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(fileConfigToBrowserTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -922,18 +938,27 @@ public abstract class BsFileConfigToBrowserTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* fileConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToBrowserTypeMappingList, new SpecifyQuery<FileConfigToBrowserTypeMappingCB>() {
* public void specify(FileConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* fileConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToBrowserTypeMappingList, new SpecifyQuery<FileConfigToBrowserTypeMappingCB>() {
* public void specify(FileConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param fileConfigToBrowserTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -712,7 +712,9 @@ public abstract class BsFileConfigToLabelTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param fileConfigToLabelTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -845,8 +847,8 @@ public abstract class BsFileConfigToLabelTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param fileConfigToLabelTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -879,13 +881,14 @@ public abstract class BsFileConfigToLabelTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* fileConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToLabelTypeMappingList, new SpecifyQuery<FileConfigToLabelTypeMappingCB>() {
* public void specify(FileConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -903,10 +906,23 @@ public abstract class BsFileConfigToLabelTypeMappingBhv extends
final UpdateOption<FileConfigToLabelTypeMappingCB> option) {
assertObjectNotNull("fileConfigToLabelTypeMappingList",
fileConfigToLabelTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(fileConfigToLabelTypeMappingList, option);
return delegateBatchUpdate(fileConfigToLabelTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<FileConfigToLabelTypeMapping> fileConfigToLabelTypeMappingList,
final UpdateOption<FileConfigToLabelTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(fileConfigToLabelTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -919,18 +935,27 @@ public abstract class BsFileConfigToLabelTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* fileConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToLabelTypeMappingList, new SpecifyQuery<FileConfigToLabelTypeMappingCB>() {
* public void specify(FileConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* fileConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToLabelTypeMappingList, new SpecifyQuery<FileConfigToLabelTypeMappingCB>() {
* public void specify(FileConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param fileConfigToLabelTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -711,7 +711,9 @@ public abstract class BsFileConfigToRoleTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param fileConfigToRoleTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -844,8 +846,8 @@ public abstract class BsFileConfigToRoleTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param fileConfigToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -878,13 +880,14 @@ public abstract class BsFileConfigToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* fileConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToRoleTypeMappingList, new SpecifyQuery<FileConfigToRoleTypeMappingCB>() {
* public void specify(FileConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -902,10 +905,23 @@ public abstract class BsFileConfigToRoleTypeMappingBhv extends
final UpdateOption<FileConfigToRoleTypeMappingCB> option) {
assertObjectNotNull("fileConfigToRoleTypeMappingList",
fileConfigToRoleTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(fileConfigToRoleTypeMappingList, option);
return delegateBatchUpdate(fileConfigToRoleTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<FileConfigToRoleTypeMapping> fileConfigToRoleTypeMappingList,
final UpdateOption<FileConfigToRoleTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(fileConfigToRoleTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -918,18 +934,27 @@ public abstract class BsFileConfigToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* fileConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToRoleTypeMappingList, new SpecifyQuery<FileConfigToRoleTypeMappingCB>() {
* public void specify(FileConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* fileConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(fileConfigToRoleTypeMappingList, new SpecifyQuery<FileConfigToRoleTypeMappingCB>() {
* public void specify(FileConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param fileConfigToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -1364,7 +1364,9 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param fileCrawlingConfig The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1420,7 +1422,9 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param fileCrawlingConfig The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1603,8 +1607,8 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param fileCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1636,13 +1640,14 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* fileCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(fileCrawlingConfigList, new SpecifyQuery<FileCrawlingConfigCB>() {
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1659,10 +1664,23 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
final List<FileCrawlingConfig> fileCrawlingConfigList,
final UpdateOption<FileCrawlingConfigCB> option) {
assertObjectNotNull("fileCrawlingConfigList", fileCrawlingConfigList);
prepareUpdateOption(option);
prepareBatchUpdateOption(fileCrawlingConfigList, option);
return delegateBatchUpdate(fileCrawlingConfigList, option);
}
protected void prepareBatchUpdateOption(
final List<FileCrawlingConfig> fileCrawlingConfigList,
final UpdateOption<FileCrawlingConfigCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(fileCrawlingConfigList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1675,18 +1693,27 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* fileCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(fileCrawlingConfigList, new SpecifyQuery<FileCrawlingConfigCB>() {
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* fileCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(fileCrawlingConfigList, new SpecifyQuery<FileCrawlingConfigCB>() {
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param fileCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1703,12 +1730,13 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* fileCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(fileCrawlingConfigList, new SpecifyQuery<FileCrawlingConfigCB>() {
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1725,24 +1753,32 @@ public abstract class BsFileCrawlingConfigBhv extends AbstractBehaviorWritable {
final List<FileCrawlingConfig> fileCrawlingConfigList,
final UpdateOption<FileCrawlingConfigCB> option) {
assertObjectNotNull("fileCrawlingConfigList", fileCrawlingConfigList);
prepareUpdateOption(option);
prepareBatchUpdateOption(fileCrawlingConfigList, option);
return delegateBatchUpdateNonstrict(fileCrawlingConfigList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* fileCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(fileCrawlingConfigList, new SpecifyQuery<FileCrawlingConfigCB>() {
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* fileCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(fileCrawlingConfigList, new SpecifyQuery<FileCrawlingConfigCB>() {
* public void specify(FileCrawlingConfigCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param fileCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

File diff suppressed because it is too large Load diff

View file

@ -1209,7 +1209,9 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param labelType The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1263,7 +1265,9 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param labelType The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1436,8 +1440,8 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param labelTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1467,13 +1471,14 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* labelTypeBhv.<span style="color: #FD4747">batchUpdate</span>(labelTypeList, new SpecifyQuery<LabelTypeCB>() {
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1488,10 +1493,23 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<LabelType> labelTypeList,
final UpdateOption<LabelTypeCB> option) {
assertObjectNotNull("labelTypeList", labelTypeList);
prepareUpdateOption(option);
prepareBatchUpdateOption(labelTypeList, option);
return delegateBatchUpdate(labelTypeList, option);
}
protected void prepareBatchUpdateOption(
final List<LabelType> labelTypeList,
final UpdateOption<LabelTypeCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(labelTypeList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1504,18 +1522,27 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* labelTypeBhv.<span style="color: #FD4747">batchUpdate</span>(labelTypeList, new SpecifyQuery<LabelTypeCB>() {
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* labelTypeBhv.<span style="color: #FD4747">batchUpdate</span>(labelTypeList, new SpecifyQuery<LabelTypeCB>() {
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param labelTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1531,12 +1558,13 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* labelTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(labelTypeList, new SpecifyQuery<LabelTypeCB>() {
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1551,24 +1579,32 @@ public abstract class BsLabelTypeBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdateNonstrict(final List<LabelType> labelTypeList,
final UpdateOption<LabelTypeCB> option) {
assertObjectNotNull("labelTypeList", labelTypeList);
prepareUpdateOption(option);
prepareBatchUpdateOption(labelTypeList, option);
return delegateBatchUpdateNonstrict(labelTypeList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* labelTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(labelTypeList, new SpecifyQuery<LabelTypeCB>() {
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* labelTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(labelTypeList, new SpecifyQuery<LabelTypeCB>() {
* public void specify(LabelTypeCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param labelTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -710,7 +710,9 @@ public abstract class BsLabelTypeToRoleTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param labelTypeToRoleTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -843,8 +845,8 @@ public abstract class BsLabelTypeToRoleTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param labelTypeToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -877,13 +879,14 @@ public abstract class BsLabelTypeToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* labelTypeToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(labelTypeToRoleTypeMappingList, new SpecifyQuery<LabelTypeToRoleTypeMappingCB>() {
* public void specify(LabelTypeToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(LabelTypeToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -901,10 +904,23 @@ public abstract class BsLabelTypeToRoleTypeMappingBhv extends
final UpdateOption<LabelTypeToRoleTypeMappingCB> option) {
assertObjectNotNull("labelTypeToRoleTypeMappingList",
labelTypeToRoleTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(labelTypeToRoleTypeMappingList, option);
return delegateBatchUpdate(labelTypeToRoleTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<LabelTypeToRoleTypeMapping> labelTypeToRoleTypeMappingList,
final UpdateOption<LabelTypeToRoleTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(labelTypeToRoleTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -917,18 +933,27 @@ public abstract class BsLabelTypeToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* labelTypeToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(labelTypeToRoleTypeMappingList, new SpecifyQuery<LabelTypeToRoleTypeMappingCB>() {
* public void specify(LabelTypeToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(LabelTypeToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* labelTypeToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(labelTypeToRoleTypeMappingList, new SpecifyQuery<LabelTypeToRoleTypeMappingCB>() {
* public void specify(LabelTypeToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param labelTypeToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -667,7 +667,9 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param overlappingHost The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -722,7 +724,9 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param overlappingHost The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -902,8 +906,8 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param overlappingHostList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -934,13 +938,14 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* overlappingHostBhv.<span style="color: #FD4747">batchUpdate</span>(overlappingHostList, new SpecifyQuery<OverlappingHostCB>() {
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -956,10 +961,23 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
final List<OverlappingHost> overlappingHostList,
final UpdateOption<OverlappingHostCB> option) {
assertObjectNotNull("overlappingHostList", overlappingHostList);
prepareUpdateOption(option);
prepareBatchUpdateOption(overlappingHostList, option);
return delegateBatchUpdate(overlappingHostList, option);
}
protected void prepareBatchUpdateOption(
final List<OverlappingHost> overlappingHostList,
final UpdateOption<OverlappingHostCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(overlappingHostList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -972,18 +990,27 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* overlappingHostBhv.<span style="color: #FD4747">batchUpdate</span>(overlappingHostList, new SpecifyQuery<OverlappingHostCB>() {
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* overlappingHostBhv.<span style="color: #FD4747">batchUpdate</span>(overlappingHostList, new SpecifyQuery<OverlappingHostCB>() {
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param overlappingHostList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -999,12 +1026,13 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* overlappingHostBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(overlappingHostList, new SpecifyQuery<OverlappingHostCB>() {
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1021,24 +1049,32 @@ public abstract class BsOverlappingHostBhv extends AbstractBehaviorWritable {
final List<OverlappingHost> overlappingHostList,
final UpdateOption<OverlappingHostCB> option) {
assertObjectNotNull("overlappingHostList", overlappingHostList);
prepareUpdateOption(option);
prepareBatchUpdateOption(overlappingHostList, option);
return delegateBatchUpdateNonstrict(overlappingHostList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* overlappingHostBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(overlappingHostList, new SpecifyQuery<OverlappingHostCB>() {
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* overlappingHostBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(overlappingHostList, new SpecifyQuery<OverlappingHostCB>() {
* public void specify(OverlappingHostCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param overlappingHostList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -659,7 +659,9 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param pathMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -714,7 +716,9 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param pathMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -889,8 +893,8 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param pathMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -920,13 +924,14 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* pathMappingBhv.<span style="color: #FD4747">batchUpdate</span>(pathMappingList, new SpecifyQuery<PathMappingCB>() {
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -941,10 +946,23 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<PathMapping> pathMappingList,
final UpdateOption<PathMappingCB> option) {
assertObjectNotNull("pathMappingList", pathMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(pathMappingList, option);
return delegateBatchUpdate(pathMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<PathMapping> pathMappingList,
final UpdateOption<PathMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(pathMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -957,18 +975,27 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* pathMappingBhv.<span style="color: #FD4747">batchUpdate</span>(pathMappingList, new SpecifyQuery<PathMappingCB>() {
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* pathMappingBhv.<span style="color: #FD4747">batchUpdate</span>(pathMappingList, new SpecifyQuery<PathMappingCB>() {
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param pathMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -984,12 +1011,13 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* pathMappingBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(pathMappingList, new SpecifyQuery<PathMappingCB>() {
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1005,24 +1033,32 @@ public abstract class BsPathMappingBhv extends AbstractBehaviorWritable {
final List<PathMapping> pathMappingList,
final UpdateOption<PathMappingCB> option) {
assertObjectNotNull("pathMappingList", pathMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(pathMappingList, option);
return delegateBatchUpdateNonstrict(pathMappingList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* pathMappingBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(pathMappingList, new SpecifyQuery<PathMappingCB>() {
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* pathMappingBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(pathMappingList, new SpecifyQuery<PathMappingCB>() {
* public void specify(PathMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param pathMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -689,7 +689,9 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param requestHeader The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -744,7 +746,9 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param requestHeader The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -921,8 +925,8 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param requestHeaderList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -952,13 +956,14 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* requestHeaderBhv.<span style="color: #FD4747">batchUpdate</span>(requestHeaderList, new SpecifyQuery<RequestHeaderCB>() {
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -973,10 +978,23 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<RequestHeader> requestHeaderList,
final UpdateOption<RequestHeaderCB> option) {
assertObjectNotNull("requestHeaderList", requestHeaderList);
prepareUpdateOption(option);
prepareBatchUpdateOption(requestHeaderList, option);
return delegateBatchUpdate(requestHeaderList, option);
}
protected void prepareBatchUpdateOption(
final List<RequestHeader> requestHeaderList,
final UpdateOption<RequestHeaderCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(requestHeaderList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -989,18 +1007,27 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* requestHeaderBhv.<span style="color: #FD4747">batchUpdate</span>(requestHeaderList, new SpecifyQuery<RequestHeaderCB>() {
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* requestHeaderBhv.<span style="color: #FD4747">batchUpdate</span>(requestHeaderList, new SpecifyQuery<RequestHeaderCB>() {
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param requestHeaderList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1016,12 +1043,13 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* requestHeaderBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(requestHeaderList, new SpecifyQuery<RequestHeaderCB>() {
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1038,24 +1066,32 @@ public abstract class BsRequestHeaderBhv extends AbstractBehaviorWritable {
final List<RequestHeader> requestHeaderList,
final UpdateOption<RequestHeaderCB> option) {
assertObjectNotNull("requestHeaderList", requestHeaderList);
prepareUpdateOption(option);
prepareBatchUpdateOption(requestHeaderList, option);
return delegateBatchUpdateNonstrict(requestHeaderList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* requestHeaderBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(requestHeaderList, new SpecifyQuery<RequestHeaderCB>() {
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* requestHeaderBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(requestHeaderList, new SpecifyQuery<RequestHeaderCB>() {
* public void specify(RequestHeaderCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param requestHeaderList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -1206,7 +1206,9 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param roleType The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1260,7 +1262,9 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param roleType The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1432,8 +1436,8 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param roleTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1463,13 +1467,14 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* roleTypeBhv.<span style="color: #FD4747">batchUpdate</span>(roleTypeList, new SpecifyQuery<RoleTypeCB>() {
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1484,10 +1489,22 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<RoleType> roleTypeList,
final UpdateOption<RoleTypeCB> option) {
assertObjectNotNull("roleTypeList", roleTypeList);
prepareUpdateOption(option);
prepareBatchUpdateOption(roleTypeList, option);
return delegateBatchUpdate(roleTypeList, option);
}
protected void prepareBatchUpdateOption(final List<RoleType> roleTypeList,
final UpdateOption<RoleTypeCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(roleTypeList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1500,18 +1517,27 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* roleTypeBhv.<span style="color: #FD4747">batchUpdate</span>(roleTypeList, new SpecifyQuery<RoleTypeCB>() {
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* roleTypeBhv.<span style="color: #FD4747">batchUpdate</span>(roleTypeList, new SpecifyQuery<RoleTypeCB>() {
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param roleTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1527,12 +1553,13 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* roleTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(roleTypeList, new SpecifyQuery<RoleTypeCB>() {
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1547,24 +1574,32 @@ public abstract class BsRoleTypeBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdateNonstrict(final List<RoleType> roleTypeList,
final UpdateOption<RoleTypeCB> option) {
assertObjectNotNull("roleTypeList", roleTypeList);
prepareUpdateOption(option);
prepareBatchUpdateOption(roleTypeList, option);
return delegateBatchUpdateNonstrict(roleTypeList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* roleTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(roleTypeList, new SpecifyQuery<RoleTypeCB>() {
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* roleTypeBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(roleTypeList, new SpecifyQuery<RoleTypeCB>() {
* public void specify(RoleTypeCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param roleTypeList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

File diff suppressed because it is too large Load diff

View file

@ -652,7 +652,9 @@ public abstract class BsSearchFieldLogBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param searchFieldLog The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -777,8 +779,8 @@ public abstract class BsSearchFieldLogBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param searchFieldLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -809,13 +811,14 @@ public abstract class BsSearchFieldLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* searchFieldLogBhv.<span style="color: #FD4747">batchUpdate</span>(searchFieldLogList, new SpecifyQuery<SearchFieldLogCB>() {
* public void specify(SearchFieldLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(SearchFieldLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -831,10 +834,23 @@ public abstract class BsSearchFieldLogBhv extends AbstractBehaviorWritable {
final List<SearchFieldLog> searchFieldLogList,
final UpdateOption<SearchFieldLogCB> option) {
assertObjectNotNull("searchFieldLogList", searchFieldLogList);
prepareUpdateOption(option);
prepareBatchUpdateOption(searchFieldLogList, option);
return delegateBatchUpdate(searchFieldLogList, option);
}
protected void prepareBatchUpdateOption(
final List<SearchFieldLog> searchFieldLogList,
final UpdateOption<SearchFieldLogCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(searchFieldLogList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -847,18 +863,27 @@ public abstract class BsSearchFieldLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* searchFieldLogBhv.<span style="color: #FD4747">batchUpdate</span>(searchFieldLogList, new SpecifyQuery<SearchFieldLogCB>() {
* public void specify(SearchFieldLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(SearchFieldLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* searchFieldLogBhv.<span style="color: #FD4747">batchUpdate</span>(searchFieldLogList, new SpecifyQuery<SearchFieldLogCB>() {
* public void specify(SearchFieldLogCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param searchFieldLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -918,7 +918,9 @@ public abstract class BsSearchLogBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param searchLog The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1040,8 +1042,8 @@ public abstract class BsSearchLogBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param searchLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1071,13 +1073,14 @@ public abstract class BsSearchLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* searchLogBhv.<span style="color: #FD4747">batchUpdate</span>(searchLogList, new SpecifyQuery<SearchLogCB>() {
* public void specify(SearchLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(SearchLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1092,10 +1095,23 @@ public abstract class BsSearchLogBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<SearchLog> searchLogList,
final UpdateOption<SearchLogCB> option) {
assertObjectNotNull("searchLogList", searchLogList);
prepareUpdateOption(option);
prepareBatchUpdateOption(searchLogList, option);
return delegateBatchUpdate(searchLogList, option);
}
protected void prepareBatchUpdateOption(
final List<SearchLog> searchLogList,
final UpdateOption<SearchLogCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(searchLogList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1108,18 +1124,27 @@ public abstract class BsSearchLogBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* searchLogBhv.<span style="color: #FD4747">batchUpdate</span>(searchLogList, new SpecifyQuery<SearchLogCB>() {
* public void specify(SearchLogCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(SearchLogCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* searchLogBhv.<span style="color: #FD4747">batchUpdate</span>(searchLogList, new SpecifyQuery<SearchLogCB>() {
* public void specify(SearchLogCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param searchLogList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -873,7 +873,9 @@ public abstract class BsUserInfoBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param userInfo The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -994,8 +996,8 @@ public abstract class BsUserInfoBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param userInfoList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1025,13 +1027,14 @@ public abstract class BsUserInfoBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* userInfoBhv.<span style="color: #FD4747">batchUpdate</span>(userInfoList, new SpecifyQuery<UserInfoCB>() {
* public void specify(UserInfoCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(UserInfoCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1046,10 +1049,22 @@ public abstract class BsUserInfoBhv extends AbstractBehaviorWritable {
protected int[] doBatchUpdate(final List<UserInfo> userInfoList,
final UpdateOption<UserInfoCB> option) {
assertObjectNotNull("userInfoList", userInfoList);
prepareUpdateOption(option);
prepareBatchUpdateOption(userInfoList, option);
return delegateBatchUpdate(userInfoList, option);
}
protected void prepareBatchUpdateOption(final List<UserInfo> userInfoList,
final UpdateOption<UserInfoCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(userInfoList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1062,18 +1077,27 @@ public abstract class BsUserInfoBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* userInfoBhv.<span style="color: #FD4747">batchUpdate</span>(userInfoList, new SpecifyQuery<UserInfoCB>() {
* public void specify(UserInfoCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(UserInfoCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* userInfoBhv.<span style="color: #FD4747">batchUpdate</span>(userInfoList, new SpecifyQuery<UserInfoCB>() {
* public void specify(UserInfoCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param userInfoList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -701,7 +701,9 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param webAuthentication The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -756,7 +758,9 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param webAuthentication The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -938,8 +942,8 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param webAuthenticationList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -970,13 +974,14 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* webAuthenticationBhv.<span style="color: #FD4747">batchUpdate</span>(webAuthenticationList, new SpecifyQuery<WebAuthenticationCB>() {
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -992,10 +997,23 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
final List<WebAuthentication> webAuthenticationList,
final UpdateOption<WebAuthenticationCB> option) {
assertObjectNotNull("webAuthenticationList", webAuthenticationList);
prepareUpdateOption(option);
prepareBatchUpdateOption(webAuthenticationList, option);
return delegateBatchUpdate(webAuthenticationList, option);
}
protected void prepareBatchUpdateOption(
final List<WebAuthentication> webAuthenticationList,
final UpdateOption<WebAuthenticationCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(webAuthenticationList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1008,18 +1026,27 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* webAuthenticationBhv.<span style="color: #FD4747">batchUpdate</span>(webAuthenticationList, new SpecifyQuery<WebAuthenticationCB>() {
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* webAuthenticationBhv.<span style="color: #FD4747">batchUpdate</span>(webAuthenticationList, new SpecifyQuery<WebAuthenticationCB>() {
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param webAuthenticationList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1036,12 +1063,13 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* webAuthenticationBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(webAuthenticationList, new SpecifyQuery<WebAuthenticationCB>() {
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1058,24 +1086,32 @@ public abstract class BsWebAuthenticationBhv extends AbstractBehaviorWritable {
final List<WebAuthentication> webAuthenticationList,
final UpdateOption<WebAuthenticationCB> option) {
assertObjectNotNull("webAuthenticationList", webAuthenticationList);
prepareUpdateOption(option);
prepareBatchUpdateOption(webAuthenticationList, option);
return delegateBatchUpdateNonstrict(webAuthenticationList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* webAuthenticationBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(webAuthenticationList, new SpecifyQuery<WebAuthenticationCB>() {
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* webAuthenticationBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(webAuthenticationList, new SpecifyQuery<WebAuthenticationCB>() {
* public void specify(WebAuthenticationCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param webAuthenticationList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -714,7 +714,9 @@ public abstract class BsWebConfigToBrowserTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param webConfigToBrowserTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -847,8 +849,8 @@ public abstract class BsWebConfigToBrowserTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param webConfigToBrowserTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -881,13 +883,14 @@ public abstract class BsWebConfigToBrowserTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* webConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToBrowserTypeMappingList, new SpecifyQuery<WebConfigToBrowserTypeMappingCB>() {
* public void specify(WebConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -905,10 +908,23 @@ public abstract class BsWebConfigToBrowserTypeMappingBhv extends
final UpdateOption<WebConfigToBrowserTypeMappingCB> option) {
assertObjectNotNull("webConfigToBrowserTypeMappingList",
webConfigToBrowserTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(webConfigToBrowserTypeMappingList, option);
return delegateBatchUpdate(webConfigToBrowserTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<WebConfigToBrowserTypeMapping> webConfigToBrowserTypeMappingList,
final UpdateOption<WebConfigToBrowserTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(webConfigToBrowserTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -921,18 +937,27 @@ public abstract class BsWebConfigToBrowserTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* webConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToBrowserTypeMappingList, new SpecifyQuery<WebConfigToBrowserTypeMappingCB>() {
* public void specify(WebConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* webConfigToBrowserTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToBrowserTypeMappingList, new SpecifyQuery<WebConfigToBrowserTypeMappingCB>() {
* public void specify(WebConfigToBrowserTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param webConfigToBrowserTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -711,7 +711,9 @@ public abstract class BsWebConfigToLabelTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param webConfigToLabelTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -844,8 +846,8 @@ public abstract class BsWebConfigToLabelTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param webConfigToLabelTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -878,13 +880,14 @@ public abstract class BsWebConfigToLabelTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* webConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToLabelTypeMappingList, new SpecifyQuery<WebConfigToLabelTypeMappingCB>() {
* public void specify(WebConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -902,10 +905,23 @@ public abstract class BsWebConfigToLabelTypeMappingBhv extends
final UpdateOption<WebConfigToLabelTypeMappingCB> option) {
assertObjectNotNull("webConfigToLabelTypeMappingList",
webConfigToLabelTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(webConfigToLabelTypeMappingList, option);
return delegateBatchUpdate(webConfigToLabelTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<WebConfigToLabelTypeMapping> webConfigToLabelTypeMappingList,
final UpdateOption<WebConfigToLabelTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(webConfigToLabelTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -918,18 +934,27 @@ public abstract class BsWebConfigToLabelTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* webConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToLabelTypeMappingList, new SpecifyQuery<WebConfigToLabelTypeMappingCB>() {
* public void specify(WebConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* webConfigToLabelTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToLabelTypeMappingList, new SpecifyQuery<WebConfigToLabelTypeMappingCB>() {
* public void specify(WebConfigToLabelTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param webConfigToLabelTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -711,7 +711,9 @@ public abstract class BsWebConfigToRoleTypeMappingBhv extends
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param webConfigToRoleTypeMapping The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -844,8 +846,8 @@ public abstract class BsWebConfigToRoleTypeMappingBhv extends
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param webConfigToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -878,13 +880,14 @@ public abstract class BsWebConfigToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* webConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToRoleTypeMappingList, new SpecifyQuery<WebConfigToRoleTypeMappingCB>() {
* public void specify(WebConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -902,10 +905,23 @@ public abstract class BsWebConfigToRoleTypeMappingBhv extends
final UpdateOption<WebConfigToRoleTypeMappingCB> option) {
assertObjectNotNull("webConfigToRoleTypeMappingList",
webConfigToRoleTypeMappingList);
prepareUpdateOption(option);
prepareBatchUpdateOption(webConfigToRoleTypeMappingList, option);
return delegateBatchUpdate(webConfigToRoleTypeMappingList, option);
}
protected void prepareBatchUpdateOption(
final List<WebConfigToRoleTypeMapping> webConfigToRoleTypeMappingList,
final UpdateOption<WebConfigToRoleTypeMappingCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(webConfigToRoleTypeMappingList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -918,18 +934,27 @@ public abstract class BsWebConfigToRoleTypeMappingBhv extends
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* webConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToRoleTypeMappingList, new SpecifyQuery<WebConfigToRoleTypeMappingCB>() {
* public void specify(WebConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* webConfigToRoleTypeMappingBhv.<span style="color: #FD4747">batchUpdate</span>(webConfigToRoleTypeMappingList, new SpecifyQuery<WebConfigToRoleTypeMappingCB>() {
* public void specify(WebConfigToRoleTypeMappingCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param webConfigToRoleTypeMappingList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -1494,7 +1494,9 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl)
* Insert or update the entity modified-only. (DefaultConstraintsEnabled, ExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() } <br />
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param webCrawlingConfig The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyUpdatedException When the entity has already been updated.
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1549,7 +1551,9 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
}
/**
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl)
* Insert or update the entity non-strictly modified-only. (DefaultConstraintsEnabled, NonExclusiveControl) <br />
* if (the entity has no PK) { insert() } else { update(), but no data, insert() }
* <p><span style="color: #FD4747; font-size: 120%">Attention, you cannot update by unique keys instead of PK.</span></p>
* @param webCrawlingConfig The entity of insert or update target. (NotNull)
* @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. (not found)
* @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated.
@ -1731,8 +1735,8 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
// ============
/**
* Batch-insert the entity list. (DefaultConstraintsDisabled) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are insert target. (so default constraints are not available in this method)</span> <br />
* This method uses executeBatch() of java.sql.PreparedStatement.
* <p><span style="color: #FD4747; font-size: 120%">Attention, all columns are insert target. (so default constraints are not available)</span></p>
* And if the table has an identity, entities after the process don't have incremented values.
* When you use the (normal) insert(), an entity after the process has an incremented value.
* @param webCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNullAllowed: when auto-increment)
@ -1763,13 +1767,14 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (AllColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() method, which you can specify update columns like this:
* <span style="color: #FD4747; font-size: 140%">Attention, all columns are update target. {NOT modified only}</span> <br />
* So you should the other batchUpdate() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* webCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(webCrawlingConfigList, new SpecifyQuery<WebCrawlingConfigCB>() {
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1785,10 +1790,23 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
final List<WebCrawlingConfig> webCrawlingConfigList,
final UpdateOption<WebCrawlingConfigCB> option) {
assertObjectNotNull("webCrawlingConfigList", webCrawlingConfigList);
prepareUpdateOption(option);
prepareBatchUpdateOption(webCrawlingConfigList, option);
return delegateBatchUpdate(webCrawlingConfigList, option);
}
protected void prepareBatchUpdateOption(
final List<WebCrawlingConfig> webCrawlingConfigList,
final UpdateOption<WebCrawlingConfigCB> option) {
if (option == null) {
return;
}
prepareUpdateOption(option);
// under review
//if (option.hasSpecifiedUpdateColumn()) {
// option.xgatherUpdateColumnModifiedProperties(webCrawlingConfigList);
//}
}
@Override
protected int[] doLumpModify(final List<Entity> ls,
final UpdateOption<? extends ConditionBean> option) {
@ -1801,18 +1819,27 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
/**
* Batch-update the entity list. (SpecifiedColumnsUpdated, ExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* webCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(webCrawlingConfigList, new SpecifyQuery<WebCrawlingConfigCB>() {
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* webCrawlingConfigBhv.<span style="color: #FD4747">batchUpdate</span>(webCrawlingConfigList, new SpecifyQuery<WebCrawlingConfigCB>() {
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).
* But if you specify every column, it has no check.</p>
* @param webCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)
@ -1829,12 +1856,13 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
* Batch-update the entity list non-strictly. (AllColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* <span style="color: #FD4747">All columns are update target. {NOT modified only}</span>
* So you should the other batchUpdate() method, which you can specify update columns like this:
* So you should the other batchUpdateNonstrict() (overload) method for performace,
* which you can specify update columns like this:
* <pre>
* webCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(webCrawlingConfigList, new SpecifyQuery<WebCrawlingConfigCB>() {
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>;
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>;
* }
* });
* </pre>
@ -1851,24 +1879,32 @@ public abstract class BsWebCrawlingConfigBhv extends AbstractBehaviorWritable {
final List<WebCrawlingConfig> webCrawlingConfigList,
final UpdateOption<WebCrawlingConfigCB> option) {
assertObjectNotNull("webCrawlingConfigList", webCrawlingConfigList);
prepareUpdateOption(option);
prepareBatchUpdateOption(webCrawlingConfigList, option);
return delegateBatchUpdateNonstrict(webCrawlingConfigList, option);
}
/**
* Batch-update the entity list non-strictly. (SpecifiedColumnsUpdated, NonExclusiveControl) <br />
* This method uses executeBatch() of java.sql.PreparedStatement. <br />
* You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistick lock column because they are specified implicitly.
* This method uses executeBatch() of java.sql.PreparedStatement.
* <pre>
* <span style="color: #3F7E5E">// e.g. update two columns only</span>
* webCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(webCrawlingConfigList, new SpecifyQuery<WebCrawlingConfigCB>() {
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// FOO_STATUS_CODE, BAR_DATE only updated</span>
* cb.specify().columnFooStatusCode();
* cb.specify().columnBarDate();
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// the two only updated</span>
* cb.specify().<span style="color: #FD4747">columnFooStatusCode()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* cb.specify().<span style="color: #FD4747">columnBarDate()</span>; <span style="color: #3F7E5E">// should be modified in any entities</span>
* }
* });
* <span style="color: #3F7E5E">// e.g. update every column in the table</span>
* webCrawlingConfigBhv.<span style="color: #FD4747">batchUpdateNonstrict</span>(webCrawlingConfigList, new SpecifyQuery<WebCrawlingConfigCB>() {
* public void specify(WebCrawlingConfigCB cb) { <span style="color: #3F7E5E">// all columns are updated</span>
* cb.specify().<span style="color: #FD4747">columnEveryColumn()</span>; <span style="color: #3F7E5E">// no check of modified properties</span>
* }
* });
* </pre>
* <p>You can specify update columns used on set clause of update statement.
* However you do not need to specify common columns for update
* and an optimistic lock column because they are specified implicitly.</p>
* <p>And you should specify columns that are modified in any entities (at least one entity).</p>
* @param webCrawlingConfigList The list of the entity. (NotNull, EmptyAllowed, PrimaryKeyNotNull)
* @param updateColumnSpec The specification of update columns. (NotNull)
* @return The array of updated count. (NotNull, EmptyAllowed)

View file

@ -0,0 +1,496 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.db.bsentity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import jp.sf.fess.db.allcommon.DBMetaInstanceHandler;
import jp.sf.fess.db.exentity.JobLog;
import org.seasar.dbflute.Entity;
import org.seasar.dbflute.dbmeta.DBMeta;
/**
* The entity of JOB_LOG as TABLE. <br />
* <pre>
* [primary-key]
* ID
*
* [column]
* ID, JOB_NAME, JOB_STATUS, TARGET, SCRIPT_TYPE, SCRIPT_DATA, SCRIPT_RESULT, START_TIME, END_TIME
*
* [sequence]
*
*
* [identity]
* ID
*
* [version-no]
*
*
* [foreign table]
*
*
* [referrer table]
*
*
* [foreign property]
*
*
* [referrer property]
*
*
* [get/set template]
* /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Long id = entity.getId();
* String jobName = entity.getJobName();
* String jobStatus = entity.getJobStatus();
* String target = entity.getTarget();
* String scriptType = entity.getScriptType();
* String scriptData = entity.getScriptData();
* String scriptResult = entity.getScriptResult();
* java.sql.Timestamp startTime = entity.getStartTime();
* java.sql.Timestamp endTime = entity.getEndTime();
* entity.setId(id);
* entity.setJobName(jobName);
* entity.setJobStatus(jobStatus);
* entity.setTarget(target);
* entity.setScriptType(scriptType);
* entity.setScriptData(scriptData);
* entity.setScriptResult(scriptResult);
* entity.setStartTime(startTime);
* entity.setEndTime(endTime);
* = = = = = = = = = =/
* </pre>
* @author DBFlute(AutoGenerator)
*/
public abstract class BsJobLog implements Entity, Serializable, Cloneable {
// ===================================================================================
// Definition
// ==========
/** Serial version UID. (Default) */
private static final long serialVersionUID = 1L;
// ===================================================================================
// Attribute
// =========
// -----------------------------------------------------
// Column
// ------
/** ID: {PK, ID, NotNull, BIGINT(19)} */
protected Long _id;
/** JOB_NAME: {NotNull, VARCHAR(100)} */
protected String _jobName;
/** JOB_STATUS: {NotNull, VARCHAR(10)} */
protected String _jobStatus;
/** TARGET: {NotNull, VARCHAR(100)} */
protected String _target;
/** SCRIPT_TYPE: {NotNull, VARCHAR(100)} */
protected String _scriptType;
/** SCRIPT_DATA: {VARCHAR(4000)} */
protected String _scriptData;
/** SCRIPT_RESULT: {VARCHAR(4000)} */
protected String _scriptResult;
/** START_TIME: {NotNull, TIMESTAMP(23, 10)} */
protected java.sql.Timestamp _startTime;
/** END_TIME: {NotNull, TIMESTAMP(23, 10)} */
protected java.sql.Timestamp _endTime;
// -----------------------------------------------------
// Internal
// --------
/** The modified properties for this entity. (NotNull) */
protected final EntityModifiedProperties __modifiedProperties = newModifiedProperties();
// ===================================================================================
// Table Name
// ==========
/**
* {@inheritDoc}
*/
@Override
public String getTableDbName() {
return "JOB_LOG";
}
/**
* {@inheritDoc}
*/
@Override
public String getTablePropertyName() { // according to Java Beans rule
return "jobLog";
}
// ===================================================================================
// DBMeta
// ======
/**
* {@inheritDoc}
*/
@Override
public DBMeta getDBMeta() {
return DBMetaInstanceHandler.findDBMeta(getTableDbName());
}
// ===================================================================================
// Primary Key
// ===========
/**
* {@inheritDoc}
*/
@Override
public boolean hasPrimaryKeyValue() {
if (getId() == null) {
return false;
}
return true;
}
// ===================================================================================
// Foreign Property
// ================
// ===================================================================================
// Referrer Property
// =================
protected <ELEMENT> List<ELEMENT> newReferrerList() {
return new ArrayList<ELEMENT>();
}
// ===================================================================================
// Modified Properties
// ===================
/**
* {@inheritDoc}
*/
@Override
public Set<String> modifiedProperties() {
return __modifiedProperties.getPropertyNames();
}
/**
* {@inheritDoc}
*/
@Override
public void clearModifiedInfo() {
__modifiedProperties.clear();
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasModification() {
return !__modifiedProperties.isEmpty();
}
protected EntityModifiedProperties newModifiedProperties() {
return new EntityModifiedProperties();
}
// ===================================================================================
// Basic Override
// ==============
/**
* Determine the object is equal with this. <br />
* If primary-keys or columns of the other are same as this one, returns true.
* @param other The other entity. (NullAllowed: if null, returns false fixedly)
* @return Comparing result.
*/
@Override
public boolean equals(final Object other) {
if (other == null || !(other instanceof BsJobLog)) {
return false;
}
final BsJobLog otherEntity = (BsJobLog) other;
if (!xSV(getId(), otherEntity.getId())) {
return false;
}
return true;
}
protected boolean xSV(final Object value1, final Object value2) { // isSameValue()
return InternalUtil.isSameValue(value1, value2);
}
/**
* Calculate the hash-code from primary-keys or columns.
* @return The hash-code from primary-key or columns.
*/
@Override
public int hashCode() {
int result = 17;
result = xCH(result, getTableDbName());
result = xCH(result, getId());
return result;
}
protected int xCH(final int result, final Object value) { // calculateHashcode()
return InternalUtil.calculateHashcode(result, value);
}
/**
* {@inheritDoc}
*/
@Override
public int instanceHash() {
return super.hashCode();
}
/**
* Convert to display string of entity's data. (no relation data)
* @return The display string of all columns and relation existences. (NotNull)
*/
@Override
public String toString() {
return buildDisplayString(InternalUtil.toClassTitle(this), true, true);
}
/**
* {@inheritDoc}
*/
@Override
public String toStringWithRelation() {
final StringBuilder sb = new StringBuilder();
sb.append(toString());
return sb.toString();
}
/**
* {@inheritDoc}
*/
@Override
public String buildDisplayString(final String name, final boolean column,
final boolean relation) {
final StringBuilder sb = new StringBuilder();
if (name != null) {
sb.append(name).append(column || relation ? ":" : "");
}
if (column) {
sb.append(buildColumnString());
}
if (relation) {
sb.append(buildRelationString());
}
sb.append("@").append(Integer.toHexString(hashCode()));
return sb.toString();
}
protected String buildColumnString() {
final StringBuilder sb = new StringBuilder();
final String delimiter = ", ";
sb.append(delimiter).append(getId());
sb.append(delimiter).append(getJobName());
sb.append(delimiter).append(getJobStatus());
sb.append(delimiter).append(getTarget());
sb.append(delimiter).append(getScriptType());
sb.append(delimiter).append(getScriptData());
sb.append(delimiter).append(getScriptResult());
sb.append(delimiter).append(getStartTime());
sb.append(delimiter).append(getEndTime());
if (sb.length() > delimiter.length()) {
sb.delete(0, delimiter.length());
}
sb.insert(0, "{").append("}");
return sb.toString();
}
protected String buildRelationString() {
return "";
}
/**
* Clone entity instance using super.clone(). (shallow copy)
* @return The cloned instance of this entity. (NotNull)
*/
@Override
public JobLog clone() {
try {
return (JobLog) super.clone();
} catch (final CloneNotSupportedException e) {
throw new IllegalStateException("Failed to clone the entity: "
+ toString(), e);
}
}
// ===================================================================================
// Accessor
// ========
/**
* [get] ID: {PK, ID, NotNull, BIGINT(19)} <br />
* @return The value of the column 'ID'. (basically NotNull if selected: for the constraint)
*/
public Long getId() {
return _id;
}
/**
* [set] ID: {PK, ID, NotNull, BIGINT(19)} <br />
* @param id The value of the column 'ID'. (basically NotNull if update: for the constraint)
*/
public void setId(final Long id) {
__modifiedProperties.addPropertyName("id");
_id = id;
}
/**
* [get] JOB_NAME: {NotNull, VARCHAR(100)} <br />
* @return The value of the column 'JOB_NAME'. (basically NotNull if selected: for the constraint)
*/
public String getJobName() {
return _jobName;
}
/**
* [set] JOB_NAME: {NotNull, VARCHAR(100)} <br />
* @param jobName The value of the column 'JOB_NAME'. (basically NotNull if update: for the constraint)
*/
public void setJobName(final String jobName) {
__modifiedProperties.addPropertyName("jobName");
_jobName = jobName;
}
/**
* [get] JOB_STATUS: {NotNull, VARCHAR(10)} <br />
* @return The value of the column 'JOB_STATUS'. (basically NotNull if selected: for the constraint)
*/
public String getJobStatus() {
return _jobStatus;
}
/**
* [set] JOB_STATUS: {NotNull, VARCHAR(10)} <br />
* @param jobStatus The value of the column 'JOB_STATUS'. (basically NotNull if update: for the constraint)
*/
public void setJobStatus(final String jobStatus) {
__modifiedProperties.addPropertyName("jobStatus");
_jobStatus = jobStatus;
}
/**
* [get] TARGET: {NotNull, VARCHAR(100)} <br />
* @return The value of the column 'TARGET'. (basically NotNull if selected: for the constraint)
*/
public String getTarget() {
return _target;
}
/**
* [set] TARGET: {NotNull, VARCHAR(100)} <br />
* @param target The value of the column 'TARGET'. (basically NotNull if update: for the constraint)
*/
public void setTarget(final String target) {
__modifiedProperties.addPropertyName("target");
_target = target;
}
/**
* [get] SCRIPT_TYPE: {NotNull, VARCHAR(100)} <br />
* @return The value of the column 'SCRIPT_TYPE'. (basically NotNull if selected: for the constraint)
*/
public String getScriptType() {
return _scriptType;
}
/**
* [set] SCRIPT_TYPE: {NotNull, VARCHAR(100)} <br />
* @param scriptType The value of the column 'SCRIPT_TYPE'. (basically NotNull if update: for the constraint)
*/
public void setScriptType(final String scriptType) {
__modifiedProperties.addPropertyName("scriptType");
_scriptType = scriptType;
}
/**
* [get] SCRIPT_DATA: {VARCHAR(4000)} <br />
* @return The value of the column 'SCRIPT_DATA'. (NullAllowed even if selected: for no constraint)
*/
public String getScriptData() {
return _scriptData;
}
/**
* [set] SCRIPT_DATA: {VARCHAR(4000)} <br />
* @param scriptData The value of the column 'SCRIPT_DATA'. (NullAllowed: null update allowed for no constraint)
*/
public void setScriptData(final String scriptData) {
__modifiedProperties.addPropertyName("scriptData");
_scriptData = scriptData;
}
/**
* [get] SCRIPT_RESULT: {VARCHAR(4000)} <br />
* @return The value of the column 'SCRIPT_RESULT'. (NullAllowed even if selected: for no constraint)
*/
public String getScriptResult() {
return _scriptResult;
}
/**
* [set] SCRIPT_RESULT: {VARCHAR(4000)} <br />
* @param scriptResult The value of the column 'SCRIPT_RESULT'. (NullAllowed: null update allowed for no constraint)
*/
public void setScriptResult(final String scriptResult) {
__modifiedProperties.addPropertyName("scriptResult");
_scriptResult = scriptResult;
}
/**
* [get] START_TIME: {NotNull, TIMESTAMP(23, 10)} <br />
* @return The value of the column 'START_TIME'. (basically NotNull if selected: for the constraint)
*/
public java.sql.Timestamp getStartTime() {
return _startTime;
}
/**
* [set] START_TIME: {NotNull, TIMESTAMP(23, 10)} <br />
* @param startTime The value of the column 'START_TIME'. (basically NotNull if update: for the constraint)
*/
public void setStartTime(final java.sql.Timestamp startTime) {
__modifiedProperties.addPropertyName("startTime");
_startTime = startTime;
}
/**
* [get] END_TIME: {NotNull, TIMESTAMP(23, 10)} <br />
* @return The value of the column 'END_TIME'. (basically NotNull if selected: for the constraint)
*/
public java.sql.Timestamp getEndTime() {
return _endTime;
}
/**
* [set] END_TIME: {NotNull, TIMESTAMP(23, 10)} <br />
* @param endTime The value of the column 'END_TIME'. (basically NotNull if update: for the constraint)
*/
public void setEndTime(final java.sql.Timestamp endTime) {
__modifiedProperties.addPropertyName("endTime");
_endTime = endTime;
}
}

View file

@ -0,0 +1,657 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.db.bsentity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import jp.sf.fess.db.allcommon.DBMetaInstanceHandler;
import jp.sf.fess.db.exentity.ScheduledJob;
import org.seasar.dbflute.Entity;
import org.seasar.dbflute.dbmeta.DBMeta;
/**
* The entity of SCHEDULED_JOB as TABLE. <br />
* <pre>
* [primary-key]
* ID
*
* [column]
* ID, NAME, TARGET, CRON_EXPRESSION, SCRIPT_TYPE, SCRIPT_DATA, CRAWLER, JOB_LOGGING, SORT_ORDER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DELETED_BY, DELETED_TIME, VERSION_NO
*
* [sequence]
*
*
* [identity]
* ID
*
* [version-no]
* VERSION_NO
*
* [foreign table]
*
*
* [referrer table]
*
*
* [foreign property]
*
*
* [referrer property]
*
*
* [get/set template]
* /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Long id = entity.getId();
* String name = entity.getName();
* String target = entity.getTarget();
* String cronExpression = entity.getCronExpression();
* String scriptType = entity.getScriptType();
* String scriptData = entity.getScriptData();
* String crawler = entity.getCrawler();
* String jobLogging = entity.getJobLogging();
* Integer sortOrder = entity.getSortOrder();
* String createdBy = entity.getCreatedBy();
* java.sql.Timestamp createdTime = entity.getCreatedTime();
* String updatedBy = entity.getUpdatedBy();
* java.sql.Timestamp updatedTime = entity.getUpdatedTime();
* String deletedBy = entity.getDeletedBy();
* java.sql.Timestamp deletedTime = entity.getDeletedTime();
* Integer versionNo = entity.getVersionNo();
* entity.setId(id);
* entity.setName(name);
* entity.setTarget(target);
* entity.setCronExpression(cronExpression);
* entity.setScriptType(scriptType);
* entity.setScriptData(scriptData);
* entity.setCrawler(crawler);
* entity.setJobLogging(jobLogging);
* entity.setSortOrder(sortOrder);
* entity.setCreatedBy(createdBy);
* entity.setCreatedTime(createdTime);
* entity.setUpdatedBy(updatedBy);
* entity.setUpdatedTime(updatedTime);
* entity.setDeletedBy(deletedBy);
* entity.setDeletedTime(deletedTime);
* entity.setVersionNo(versionNo);
* = = = = = = = = = =/
* </pre>
* @author DBFlute(AutoGenerator)
*/
public abstract class BsScheduledJob implements Entity, Serializable, Cloneable {
// ===================================================================================
// Definition
// ==========
/** Serial version UID. (Default) */
private static final long serialVersionUID = 1L;
// ===================================================================================
// Attribute
// =========
// -----------------------------------------------------
// Column
// ------
/** ID: {PK, ID, NotNull, BIGINT(19)} */
protected Long _id;
/** NAME: {NotNull, VARCHAR(100)} */
protected String _name;
/** TARGET: {NotNull, VARCHAR(100)} */
protected String _target;
/** CRON_EXPRESSION: {NotNull, VARCHAR(100)} */
protected String _cronExpression;
/** SCRIPT_TYPE: {NotNull, VARCHAR(100)} */
protected String _scriptType;
/** SCRIPT_DATA: {VARCHAR(4000)} */
protected String _scriptData;
/** CRAWLER: {NotNull, VARCHAR(1)} */
protected String _crawler;
/** JOB_LOGGING: {NotNull, VARCHAR(1)} */
protected String _jobLogging;
/** SORT_ORDER: {NotNull, INTEGER(10)} */
protected Integer _sortOrder;
/** CREATED_BY: {NotNull, VARCHAR(255)} */
protected String _createdBy;
/** CREATED_TIME: {NotNull, TIMESTAMP(23, 10)} */
protected java.sql.Timestamp _createdTime;
/** UPDATED_BY: {VARCHAR(255)} */
protected String _updatedBy;
/** UPDATED_TIME: {TIMESTAMP(23, 10)} */
protected java.sql.Timestamp _updatedTime;
/** DELETED_BY: {VARCHAR(255)} */
protected String _deletedBy;
/** DELETED_TIME: {TIMESTAMP(23, 10)} */
protected java.sql.Timestamp _deletedTime;
/** VERSION_NO: {NotNull, INTEGER(10)} */
protected Integer _versionNo;
// -----------------------------------------------------
// Internal
// --------
/** The modified properties for this entity. (NotNull) */
protected final EntityModifiedProperties __modifiedProperties = newModifiedProperties();
// ===================================================================================
// Table Name
// ==========
/**
* {@inheritDoc}
*/
@Override
public String getTableDbName() {
return "SCHEDULED_JOB";
}
/**
* {@inheritDoc}
*/
@Override
public String getTablePropertyName() { // according to Java Beans rule
return "scheduledJob";
}
// ===================================================================================
// DBMeta
// ======
/**
* {@inheritDoc}
*/
@Override
public DBMeta getDBMeta() {
return DBMetaInstanceHandler.findDBMeta(getTableDbName());
}
// ===================================================================================
// Primary Key
// ===========
/**
* {@inheritDoc}
*/
@Override
public boolean hasPrimaryKeyValue() {
if (getId() == null) {
return false;
}
return true;
}
// ===================================================================================
// Foreign Property
// ================
// ===================================================================================
// Referrer Property
// =================
protected <ELEMENT> List<ELEMENT> newReferrerList() {
return new ArrayList<ELEMENT>();
}
// ===================================================================================
// Modified Properties
// ===================
/**
* {@inheritDoc}
*/
@Override
public Set<String> modifiedProperties() {
return __modifiedProperties.getPropertyNames();
}
/**
* {@inheritDoc}
*/
@Override
public void clearModifiedInfo() {
__modifiedProperties.clear();
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasModification() {
return !__modifiedProperties.isEmpty();
}
protected EntityModifiedProperties newModifiedProperties() {
return new EntityModifiedProperties();
}
// ===================================================================================
// Basic Override
// ==============
/**
* Determine the object is equal with this. <br />
* If primary-keys or columns of the other are same as this one, returns true.
* @param other The other entity. (NullAllowed: if null, returns false fixedly)
* @return Comparing result.
*/
@Override
public boolean equals(final Object other) {
if (other == null || !(other instanceof BsScheduledJob)) {
return false;
}
final BsScheduledJob otherEntity = (BsScheduledJob) other;
if (!xSV(getId(), otherEntity.getId())) {
return false;
}
return true;
}
protected boolean xSV(final Object value1, final Object value2) { // isSameValue()
return InternalUtil.isSameValue(value1, value2);
}
/**
* Calculate the hash-code from primary-keys or columns.
* @return The hash-code from primary-key or columns.
*/
@Override
public int hashCode() {
int result = 17;
result = xCH(result, getTableDbName());
result = xCH(result, getId());
return result;
}
protected int xCH(final int result, final Object value) { // calculateHashcode()
return InternalUtil.calculateHashcode(result, value);
}
/**
* {@inheritDoc}
*/
@Override
public int instanceHash() {
return super.hashCode();
}
/**
* Convert to display string of entity's data. (no relation data)
* @return The display string of all columns and relation existences. (NotNull)
*/
@Override
public String toString() {
return buildDisplayString(InternalUtil.toClassTitle(this), true, true);
}
/**
* {@inheritDoc}
*/
@Override
public String toStringWithRelation() {
final StringBuilder sb = new StringBuilder();
sb.append(toString());
return sb.toString();
}
/**
* {@inheritDoc}
*/
@Override
public String buildDisplayString(final String name, final boolean column,
final boolean relation) {
final StringBuilder sb = new StringBuilder();
if (name != null) {
sb.append(name).append(column || relation ? ":" : "");
}
if (column) {
sb.append(buildColumnString());
}
if (relation) {
sb.append(buildRelationString());
}
sb.append("@").append(Integer.toHexString(hashCode()));
return sb.toString();
}
protected String buildColumnString() {
final StringBuilder sb = new StringBuilder();
final String delimiter = ", ";
sb.append(delimiter).append(getId());
sb.append(delimiter).append(getName());
sb.append(delimiter).append(getTarget());
sb.append(delimiter).append(getCronExpression());
sb.append(delimiter).append(getScriptType());
sb.append(delimiter).append(getScriptData());
sb.append(delimiter).append(getCrawler());
sb.append(delimiter).append(getJobLogging());
sb.append(delimiter).append(getSortOrder());
sb.append(delimiter).append(getCreatedBy());
sb.append(delimiter).append(getCreatedTime());
sb.append(delimiter).append(getUpdatedBy());
sb.append(delimiter).append(getUpdatedTime());
sb.append(delimiter).append(getDeletedBy());
sb.append(delimiter).append(getDeletedTime());
sb.append(delimiter).append(getVersionNo());
if (sb.length() > delimiter.length()) {
sb.delete(0, delimiter.length());
}
sb.insert(0, "{").append("}");
return sb.toString();
}
protected String buildRelationString() {
return "";
}
/**
* Clone entity instance using super.clone(). (shallow copy)
* @return The cloned instance of this entity. (NotNull)
*/
@Override
public ScheduledJob clone() {
try {
return (ScheduledJob) super.clone();
} catch (final CloneNotSupportedException e) {
throw new IllegalStateException("Failed to clone the entity: "
+ toString(), e);
}
}
// ===================================================================================
// Accessor
// ========
/**
* [get] ID: {PK, ID, NotNull, BIGINT(19)} <br />
* @return The value of the column 'ID'. (basically NotNull if selected: for the constraint)
*/
public Long getId() {
return _id;
}
/**
* [set] ID: {PK, ID, NotNull, BIGINT(19)} <br />
* @param id The value of the column 'ID'. (basically NotNull if update: for the constraint)
*/
public void setId(final Long id) {
__modifiedProperties.addPropertyName("id");
_id = id;
}
/**
* [get] NAME: {NotNull, VARCHAR(100)} <br />
* @return The value of the column 'NAME'. (basically NotNull if selected: for the constraint)
*/
public String getName() {
return _name;
}
/**
* [set] NAME: {NotNull, VARCHAR(100)} <br />
* @param name The value of the column 'NAME'. (basically NotNull if update: for the constraint)
*/
public void setName(final String name) {
__modifiedProperties.addPropertyName("name");
_name = name;
}
/**
* [get] TARGET: {NotNull, VARCHAR(100)} <br />
* @return The value of the column 'TARGET'. (basically NotNull if selected: for the constraint)
*/
public String getTarget() {
return _target;
}
/**
* [set] TARGET: {NotNull, VARCHAR(100)} <br />
* @param target The value of the column 'TARGET'. (basically NotNull if update: for the constraint)
*/
public void setTarget(final String target) {
__modifiedProperties.addPropertyName("target");
_target = target;
}
/**
* [get] CRON_EXPRESSION: {NotNull, VARCHAR(100)} <br />
* @return The value of the column 'CRON_EXPRESSION'. (basically NotNull if selected: for the constraint)
*/
public String getCronExpression() {
return _cronExpression;
}
/**
* [set] CRON_EXPRESSION: {NotNull, VARCHAR(100)} <br />
* @param cronExpression The value of the column 'CRON_EXPRESSION'. (basically NotNull if update: for the constraint)
*/
public void setCronExpression(final String cronExpression) {
__modifiedProperties.addPropertyName("cronExpression");
_cronExpression = cronExpression;
}
/**
* [get] SCRIPT_TYPE: {NotNull, VARCHAR(100)} <br />
* @return The value of the column 'SCRIPT_TYPE'. (basically NotNull if selected: for the constraint)
*/
public String getScriptType() {
return _scriptType;
}
/**
* [set] SCRIPT_TYPE: {NotNull, VARCHAR(100)} <br />
* @param scriptType The value of the column 'SCRIPT_TYPE'. (basically NotNull if update: for the constraint)
*/
public void setScriptType(final String scriptType) {
__modifiedProperties.addPropertyName("scriptType");
_scriptType = scriptType;
}
/**
* [get] SCRIPT_DATA: {VARCHAR(4000)} <br />
* @return The value of the column 'SCRIPT_DATA'. (NullAllowed even if selected: for no constraint)
*/
public String getScriptData() {
return _scriptData;
}
/**
* [set] SCRIPT_DATA: {VARCHAR(4000)} <br />
* @param scriptData The value of the column 'SCRIPT_DATA'. (NullAllowed: null update allowed for no constraint)
*/
public void setScriptData(final String scriptData) {
__modifiedProperties.addPropertyName("scriptData");
_scriptData = scriptData;
}
/**
* [get] CRAWLER: {NotNull, VARCHAR(1)} <br />
* @return The value of the column 'CRAWLER'. (basically NotNull if selected: for the constraint)
*/
public String getCrawler() {
return _crawler;
}
/**
* [set] CRAWLER: {NotNull, VARCHAR(1)} <br />
* @param crawler The value of the column 'CRAWLER'. (basically NotNull if update: for the constraint)
*/
public void setCrawler(final String crawler) {
__modifiedProperties.addPropertyName("crawler");
_crawler = crawler;
}
/**
* [get] JOB_LOGGING: {NotNull, VARCHAR(1)} <br />
* @return The value of the column 'JOB_LOGGING'. (basically NotNull if selected: for the constraint)
*/
public String getJobLogging() {
return _jobLogging;
}
/**
* [set] JOB_LOGGING: {NotNull, VARCHAR(1)} <br />
* @param jobLogging The value of the column 'JOB_LOGGING'. (basically NotNull if update: for the constraint)
*/
public void setJobLogging(final String jobLogging) {
__modifiedProperties.addPropertyName("jobLogging");
_jobLogging = jobLogging;
}
/**
* [get] SORT_ORDER: {NotNull, INTEGER(10)} <br />
* @return The value of the column 'SORT_ORDER'. (basically NotNull if selected: for the constraint)
*/
public Integer getSortOrder() {
return _sortOrder;
}
/**
* [set] SORT_ORDER: {NotNull, INTEGER(10)} <br />
* @param sortOrder The value of the column 'SORT_ORDER'. (basically NotNull if update: for the constraint)
*/
public void setSortOrder(final Integer sortOrder) {
__modifiedProperties.addPropertyName("sortOrder");
_sortOrder = sortOrder;
}
/**
* [get] CREATED_BY: {NotNull, VARCHAR(255)} <br />
* @return The value of the column 'CREATED_BY'. (basically NotNull if selected: for the constraint)
*/
public String getCreatedBy() {
return _createdBy;
}
/**
* [set] CREATED_BY: {NotNull, VARCHAR(255)} <br />
* @param createdBy The value of the column 'CREATED_BY'. (basically NotNull if update: for the constraint)
*/
public void setCreatedBy(final String createdBy) {
__modifiedProperties.addPropertyName("createdBy");
_createdBy = createdBy;
}
/**
* [get] CREATED_TIME: {NotNull, TIMESTAMP(23, 10)} <br />
* @return The value of the column 'CREATED_TIME'. (basically NotNull if selected: for the constraint)
*/
public java.sql.Timestamp getCreatedTime() {
return _createdTime;
}
/**
* [set] CREATED_TIME: {NotNull, TIMESTAMP(23, 10)} <br />
* @param createdTime The value of the column 'CREATED_TIME'. (basically NotNull if update: for the constraint)
*/
public void setCreatedTime(final java.sql.Timestamp createdTime) {
__modifiedProperties.addPropertyName("createdTime");
_createdTime = createdTime;
}
/**
* [get] UPDATED_BY: {VARCHAR(255)} <br />
* @return The value of the column 'UPDATED_BY'. (NullAllowed even if selected: for no constraint)
*/
public String getUpdatedBy() {
return _updatedBy;
}
/**
* [set] UPDATED_BY: {VARCHAR(255)} <br />
* @param updatedBy The value of the column 'UPDATED_BY'. (NullAllowed: null update allowed for no constraint)
*/
public void setUpdatedBy(final String updatedBy) {
__modifiedProperties.addPropertyName("updatedBy");
_updatedBy = updatedBy;
}
/**
* [get] UPDATED_TIME: {TIMESTAMP(23, 10)} <br />
* @return The value of the column 'UPDATED_TIME'. (NullAllowed even if selected: for no constraint)
*/
public java.sql.Timestamp getUpdatedTime() {
return _updatedTime;
}
/**
* [set] UPDATED_TIME: {TIMESTAMP(23, 10)} <br />
* @param updatedTime The value of the column 'UPDATED_TIME'. (NullAllowed: null update allowed for no constraint)
*/
public void setUpdatedTime(final java.sql.Timestamp updatedTime) {
__modifiedProperties.addPropertyName("updatedTime");
_updatedTime = updatedTime;
}
/**
* [get] DELETED_BY: {VARCHAR(255)} <br />
* @return The value of the column 'DELETED_BY'. (NullAllowed even if selected: for no constraint)
*/
public String getDeletedBy() {
return _deletedBy;
}
/**
* [set] DELETED_BY: {VARCHAR(255)} <br />
* @param deletedBy The value of the column 'DELETED_BY'. (NullAllowed: null update allowed for no constraint)
*/
public void setDeletedBy(final String deletedBy) {
__modifiedProperties.addPropertyName("deletedBy");
_deletedBy = deletedBy;
}
/**
* [get] DELETED_TIME: {TIMESTAMP(23, 10)} <br />
* @return The value of the column 'DELETED_TIME'. (NullAllowed even if selected: for no constraint)
*/
public java.sql.Timestamp getDeletedTime() {
return _deletedTime;
}
/**
* [set] DELETED_TIME: {TIMESTAMP(23, 10)} <br />
* @param deletedTime The value of the column 'DELETED_TIME'. (NullAllowed: null update allowed for no constraint)
*/
public void setDeletedTime(final java.sql.Timestamp deletedTime) {
__modifiedProperties.addPropertyName("deletedTime");
_deletedTime = deletedTime;
}
/**
* [get] VERSION_NO: {NotNull, INTEGER(10)} <br />
* @return The value of the column 'VERSION_NO'. (basically NotNull if selected: for the constraint)
*/
public Integer getVersionNo() {
return _versionNo;
}
/**
* [set] VERSION_NO: {NotNull, INTEGER(10)} <br />
* @param versionNo The value of the column 'VERSION_NO'. (basically NotNull if update: for the constraint)
*/
public void setVersionNo(final Integer versionNo) {
__modifiedProperties.addPropertyName("versionNo");
_versionNo = versionNo;
}
}

View file

@ -258,7 +258,7 @@ public class BrowserTypeDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_3728D771_5011_423B_9471_A328218330D3",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_3392AAC5_099C_4649_A986_4AF80596489F",
false,
null,
null,

View file

@ -167,7 +167,7 @@ public class ClickLogDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_0754AF3F_61DC_4BEF_A897_50236FD8CF6F",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_052D962A_D034_4EE0_A0E1_D06990433B06",
false, null, null, null, null, null);
protected final ColumnInfo _columnSearchId = cci("SEARCH_ID", "SEARCH_ID",

View file

@ -180,7 +180,7 @@ public class CrawlingSessionDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_5161750E_9596_4D9F_A2D5_8E5D638D2491",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_159B5153_BDC0_41E6_A86E_5852A2B50490",
false, null, null, null, "crawlingSessionInfoList", null);
protected final ColumnInfo _columnSessionId = cci("SESSION_ID",

View file

@ -180,7 +180,7 @@ public class CrawlingSessionInfoDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_5B6AC213_95C9_4804_B9EE_8DB5791F2F17",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_06421DD4_26CC_40F0_848B_9976FBF88FD7",
false, null, null, null, null, null);
protected final ColumnInfo _columnCrawlingSessionId = cci(

View file

@ -154,7 +154,7 @@ public class DataConfigToBrowserTypeMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_FBD9049C_74D1_419F_AF2F_BD1263E701AB",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_40D8F041_EECB_4CC1_8B5F_F87D92B71A58",
false, null, null, null, null, null);
protected final ColumnInfo _columnDataConfigId = cci("DATA_CONFIG_ID",

View file

@ -154,7 +154,7 @@ public class DataConfigToLabelTypeMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_295CE803_7C59_49AA_8EF0_73D98987B376",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_091DD818_2B55_43D6_8E50_DF070DC6C760",
false, null, null, null, null, null);
protected final ColumnInfo _columnDataConfigId = cci("DATA_CONFIG_ID",

View file

@ -154,7 +154,7 @@ public class DataConfigToRoleTypeMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_58AD5C32_CE47_464F_82EF_3FC3F5B4DA8D",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_DC2BD25A_B8B2_4503_AA81_4FA35FBC8EFC",
false, null, null, null, null, null);
protected final ColumnInfo _columnDataConfigId = cci("DATA_CONFIG_ID",

View file

@ -310,7 +310,7 @@ public class DataCrawlingConfigDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_C6E511E5_1101_4B23_B1D3_A7F37196976E",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_69485FF1_9248_4CA0_B20B_21AAF4A55C3B",
false,
null,
null,

View file

@ -232,7 +232,7 @@ public class FailureUrlDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_A093F7FB_71DB_4534_8326_FA940E2CBCB5",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_A3DCFE27_7719_4B2E_A29F_AF845E251EC1",
false, null, null, null, null, null);
protected final ColumnInfo _columnUrl = cci("URL", "URL", null, null, true,

View file

@ -167,7 +167,7 @@ public class FavoriteLogDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_5498CEC3_BE35_4660_9428_7A1D3CEC27BD",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_F8D89584_9900_4F73_BAAC_BB7A2CEAAFCE",
false, null, null, null, null, null);
protected final ColumnInfo _columnUserId = cci("USER_ID", "USER_ID", null,

View file

@ -310,7 +310,7 @@ public class FileAuthenticationDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_6E067B9D_072D_4946_9233_92C6E3843887",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_2D07A622_2874_4837_B16D_87D02816E51F",
false, null, null, null, null, null);
protected final ColumnInfo _columnHostname = cci("HOSTNAME", "HOSTNAME",

View file

@ -154,7 +154,7 @@ public class FileConfigToBrowserTypeMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_8A5523D6_FE81_49EB_9D46_6E77E08C9C3A",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_4A2AE538_DD96_4228_A294_A736985F4E59",
false, null, null, null, null, null);
protected final ColumnInfo _columnFileConfigId = cci("FILE_CONFIG_ID",

View file

@ -154,7 +154,7 @@ public class FileConfigToLabelTypeMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_0FF88574_2CA8_4155_9BD2_9FDD47E1E56D",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_5D84DEE5_03E7_4F4C_9C55_A578CA9956F7",
false, null, null, null, null, null);
protected final ColumnInfo _columnFileConfigId = cci("FILE_CONFIG_ID",

View file

@ -154,7 +154,7 @@ public class FileConfigToRoleTypeMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_E7E4AE99_94B8_479B_AEB6_7E8C750A689B",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_DBBD643A_F36E_4CF1_B471_F959A03EEE9E",
false, null, null, null, null, null);
protected final ColumnInfo _columnFileConfigId = cci("FILE_CONFIG_ID",

View file

@ -401,7 +401,7 @@ public class FileCrawlingConfigDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_BE942DC5_22D5_4C59_9BD6_5A2FFADE870C",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_09028F6B_6A9E_45FE_8673_AD297EA85046",
false,
null,
null,

View file

@ -0,0 +1,430 @@
/*
* Copyright 2009-2013 the Fess Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package jp.sf.fess.db.bsentity.dbmeta;
import java.util.List;
import java.util.Map;
import jp.sf.fess.db.allcommon.DBCurrent;
import jp.sf.fess.db.allcommon.DBFluteConfig;
import jp.sf.fess.db.exentity.JobLog;
import org.seasar.dbflute.DBDef;
import org.seasar.dbflute.Entity;
import org.seasar.dbflute.dbmeta.AbstractDBMeta;
import org.seasar.dbflute.dbmeta.PropertyGateway;
import org.seasar.dbflute.dbmeta.info.ColumnInfo;
import org.seasar.dbflute.dbmeta.info.UniqueInfo;
import org.seasar.dbflute.dbmeta.name.TableSqlName;
/**
* The DB meta of JOB_LOG. (Singleton)
* @author DBFlute(AutoGenerator)
*/
public class JobLogDbm extends AbstractDBMeta {
// ===================================================================================
// Singleton
// =========
private static final JobLogDbm _instance = new JobLogDbm();
private JobLogDbm() {
}
public static JobLogDbm getInstance() {
return _instance;
}
// ===================================================================================
// Current DBDef
// =============
@Override
public DBDef getCurrentDBDef() {
return DBCurrent.getInstance().currentDBDef();
}
// ===================================================================================
// Property Gateway
// ================
protected final Map<String, PropertyGateway> _epgMap = newHashMap();
{
setupEpg(_epgMap, new EpgId(), "id");
setupEpg(_epgMap, new EpgJobName(), "jobName");
setupEpg(_epgMap, new EpgJobStatus(), "jobStatus");
setupEpg(_epgMap, new EpgTarget(), "target");
setupEpg(_epgMap, new EpgScriptType(), "scriptType");
setupEpg(_epgMap, new EpgScriptData(), "scriptData");
setupEpg(_epgMap, new EpgScriptResult(), "scriptResult");
setupEpg(_epgMap, new EpgStartTime(), "startTime");
setupEpg(_epgMap, new EpgEndTime(), "endTime");
}
@Override
public PropertyGateway findPropertyGateway(final String propertyName) {
return doFindEpg(_epgMap, propertyName);
}
public static class EpgId implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getId();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setId(ctl(v));
}
}
public static class EpgJobName implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getJobName();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setJobName((String) v);
}
}
public static class EpgJobStatus implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getJobStatus();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setJobStatus((String) v);
}
}
public static class EpgTarget implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getTarget();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setTarget((String) v);
}
}
public static class EpgScriptType implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getScriptType();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setScriptType((String) v);
}
}
public static class EpgScriptData implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getScriptData();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setScriptData((String) v);
}
}
public static class EpgScriptResult implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getScriptResult();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setScriptResult((String) v);
}
}
public static class EpgStartTime implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getStartTime();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setStartTime((java.sql.Timestamp) v);
}
}
public static class EpgEndTime implements PropertyGateway {
@Override
public Object read(final Entity e) {
return ((JobLog) e).getEndTime();
}
@Override
public void write(final Entity e, final Object v) {
((JobLog) e).setEndTime((java.sql.Timestamp) v);
}
}
// ===================================================================================
// Table Info
// ==========
protected final String _tableDbName = "JOB_LOG";
protected final String _tablePropertyName = "jobLog";
protected final TableSqlName _tableSqlName = new TableSqlName("JOB_LOG",
_tableDbName);
{
_tableSqlName.xacceptFilter(DBFluteConfig.getInstance()
.getTableSqlNameFilter());
}
@Override
public String getTableDbName() {
return _tableDbName;
}
@Override
public String getTablePropertyName() {
return _tablePropertyName;
}
@Override
public TableSqlName getTableSqlName() {
return _tableSqlName;
}
// ===================================================================================
// Column Info
// ===========
protected final ColumnInfo _columnId = cci(
"ID",
"ID",
null,
null,
true,
"id",
Long.class,
true,
true,
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_AE8C1452_543B_41AD_8DB1_D6C703814D9E",
false, null, null, null, null, null);
protected final ColumnInfo _columnJobName = cci("JOB_NAME", "JOB_NAME",
null, null, true, "jobName", String.class, false, false, "VARCHAR",
100, 0, null, false, null, null, null, null, null);
protected final ColumnInfo _columnJobStatus = cci("JOB_STATUS",
"JOB_STATUS", null, null, true, "jobStatus", String.class, false,
false, "VARCHAR", 10, 0, null, false, null, null, null, null, null);
protected final ColumnInfo _columnTarget = cci("TARGET", "TARGET", null,
null, true, "target", String.class, false, false, "VARCHAR", 100,
0, null, false, null, null, null, null, null);
protected final ColumnInfo _columnScriptType = cci("SCRIPT_TYPE",
"SCRIPT_TYPE", null, null, true, "scriptType", String.class, false,
false, "VARCHAR", 100, 0, null, false, null, null, null, null, null);
protected final ColumnInfo _columnScriptData = cci("SCRIPT_DATA",
"SCRIPT_DATA", null, null, false, "scriptData", String.class,
false, false, "VARCHAR", 4000, 0, null, false, null, null, null,
null, null);
protected final ColumnInfo _columnScriptResult = cci("SCRIPT_RESULT",
"SCRIPT_RESULT", null, null, false, "scriptResult", String.class,
false, false, "VARCHAR", 4000, 0, null, false, null, null, null,
null, null);
protected final ColumnInfo _columnStartTime = cci("START_TIME",
"START_TIME", null, null, true, "startTime",
java.sql.Timestamp.class, false, false, "TIMESTAMP", 23, 10, null,
false, null, null, null, null, null);
protected final ColumnInfo _columnEndTime = cci("END_TIME", "END_TIME",
null, null, true, "endTime", java.sql.Timestamp.class, false,
false, "TIMESTAMP", 23, 10, null, false, null, null, null, null,
null);
public ColumnInfo columnId() {
return _columnId;
}
public ColumnInfo columnJobName() {
return _columnJobName;
}
public ColumnInfo columnJobStatus() {
return _columnJobStatus;
}
public ColumnInfo columnTarget() {
return _columnTarget;
}
public ColumnInfo columnScriptType() {
return _columnScriptType;
}
public ColumnInfo columnScriptData() {
return _columnScriptData;
}
public ColumnInfo columnScriptResult() {
return _columnScriptResult;
}
public ColumnInfo columnStartTime() {
return _columnStartTime;
}
public ColumnInfo columnEndTime() {
return _columnEndTime;
}
@Override
protected List<ColumnInfo> ccil() {
final List<ColumnInfo> ls = newArrayList();
ls.add(columnId());
ls.add(columnJobName());
ls.add(columnJobStatus());
ls.add(columnTarget());
ls.add(columnScriptType());
ls.add(columnScriptData());
ls.add(columnScriptResult());
ls.add(columnStartTime());
ls.add(columnEndTime());
return ls;
}
{
initializeInformationResource();
}
// ===================================================================================
// Unique Info
// ===========
// -----------------------------------------------------
// Primary Element
// ---------------
@Override
protected UniqueInfo cpui() {
return hpcpui(columnId());
}
@Override
public boolean hasPrimaryKey() {
return true;
}
@Override
public boolean hasCompoundPrimaryKey() {
return false;
}
// ===================================================================================
// Relation Info
// =============
// -----------------------------------------------------
// Foreign Property
// ----------------
// -----------------------------------------------------
// Referrer Property
// -----------------
// ===================================================================================
// Various Info
// ============
@Override
public boolean hasIdentity() {
return true;
}
// ===================================================================================
// Type Name
// =========
@Override
public String getEntityTypeName() {
return "jp.sf.fess.db.exentity.JobLog";
}
@Override
public String getConditionBeanTypeName() {
return "jp.sf.fess.db.cbean.JobLogCB";
}
@Override
public String getBehaviorTypeName() {
return "jp.sf.fess.db.exbhv.JobLogBhv";
}
// ===================================================================================
// Object Type
// ===========
@Override
public Class<JobLog> getEntityType() {
return JobLog.class;
}
// ===================================================================================
// Object Instance
// ===============
@Override
public Entity newEntity() {
return newMyEntity();
}
public JobLog newMyEntity() {
return new JobLog();
}
// ===================================================================================
// Map Communication
// =================
@Override
public void acceptPrimaryKeyMap(final Entity e,
final Map<String, ? extends Object> m) {
doAcceptPrimaryKeyMap((JobLog) e, m);
}
@Override
public void acceptAllColumnMap(final Entity e,
final Map<String, ? extends Object> m) {
doAcceptAllColumnMap((JobLog) e, m);
}
@Override
public Map<String, Object> extractPrimaryKeyMap(final Entity e) {
return doExtractPrimaryKeyMap(e);
}
@Override
public Map<String, Object> extractAllColumnMap(final Entity e) {
return doExtractAllColumnMap(e);
}
}

View file

@ -284,7 +284,7 @@ public class LabelTypeDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_8B12BD6C_F878_4248_B1D5_C0E0662CFA9E",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_ABD3A922_F562_4CF2_88C4_697DDDA4D94F",
false,
null,
null,

View file

@ -154,7 +154,7 @@ public class LabelTypeToRoleTypeMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_E21C3B1F_7B77_4948_A99B_DB55AF5D8FD4",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_2795E3E2_31C9_48A3_9ACB_D0394EDA5A08",
false, null, null, null, null, null);
protected final ColumnInfo _columnLabelTypeId = cci("LABEL_TYPE_ID",

View file

@ -257,7 +257,7 @@ public class OverlappingHostDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_F8CFF4C0_E169_439C_825D_B7CF2CF967F3",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_2D2F2D35_49FB_4698_8A5F_7EACC0AD5200",
false, null, null, null, null, null);
protected final ColumnInfo _columnRegularName = cci("REGULAR_NAME",

View file

@ -271,7 +271,7 @@ public class PathMappingDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_6420173C_79A1_4CC2_8EEA_E9CF32297DB6",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_9A1C4AF5_4469_4374_938F_A7738FF05142",
false, null, null, null, null, null);
protected final ColumnInfo _columnRegex = cci("REGEX", "REGEX", null, null,

View file

@ -258,7 +258,7 @@ public class RequestHeaderDbm extends AbstractDBMeta {
"BIGINT",
19,
0,
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_DFC30F5D_4546_481E_899C_C31648081AED",
"NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_5E61292E_D7F3_4319_B50E_67C6EDD0A3E5",
false, null, null, null, null, null);
protected final ColumnInfo _columnName = cci("NAME", "NAME", null, null,

Some files were not shown because too many files have changed in this diff Show more