This commit is contained in:
Shinsuke Sugaya 2015-07-05 07:46:31 +09:00
parent db8b5aba53
commit 47a160b0e0
341 changed files with 63717 additions and 41 deletions

View file

@ -0,0 +1,9 @@
@echo off
set ANT_OPTS=-Xmx512m
set DBFLUTE_HOME=..\mydbflute\dbflute-1.1.0-sp1
set MY_PROPERTIES_PATH=build.properties
if "%pause_at_end%"=="" set pause_at_end=y

7
dbflute_fess/_project.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
export ANT_OPTS=-Xmx512m
export DBFLUTE_HOME=../mydbflute/dbflute-1.1.0-sp1
export MY_PROPERTIES_PATH=build.properties

72
dbflute_fess/_readme.txt Normal file
View file

@ -0,0 +1,72 @@
Directory for DBFlute client
manage.bat(sh) => 21 (jdbc):
A execution command of JDBC task
which gets your schema info and saves it to SchemaXML
located to the "schema" directory.
This task should be executed after ReplaceSchema task
and before other tasks(e.g. Generate, Document task).
manage.bat(sh) => 22 (doc):
A execution command of Document task
which creates documents, for example, SchemaHTML, HistoryHTML
to the "output/doc" directory.
manage.bat(sh) => 23 (generate):
A execution command of Generate task
which generates classes corresponding your tables,
for example, entities, condition-beans to specified
directories by DBFlute properties on "dfprop" directory.
Generated structures (directories and classes) are like this:
/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
allcommon : classes bridging to DBFlute Runtime
bsbhv : base behaviors
bsentity : base entities
cbean : condition-beans (both base and extended)
exbhv : extended behaviors
exentity : extended entities
- - - - - - - - - -/
For example, if a table called "MEMBER" exists,
you can use these classes like this:
/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
memberBhv.selectEntity(cb -> {
cb.query().setMemberId_Equal(3);
}).alwaysPresent(member -> {
... = member.getMemberName();
});
// memberBhv : Behavior (instance)
// MemberCB(cb) : ConditionBean
// Member(member) : Entity
- - - - - - - - - -/
manage.bat(sh) => 24 (sql2entity):
A execution command of Sql2Entity task
which generates classes corresponding your outside-SQL files,
for example, entities, parameter-beans to specified
directories by DBFlute properties on "dfprop" directory.
manage.bat(sh) => 0 (replace-schema):
A execution command of ReplaceSchema task
which creates your tables and loads data by
resources located to the "playsql" directory.
manage.bat(sh) => 25 (outside-sql-test):
A execution command of OutsideSqlTest task
which executes outside-SQL files and you can check
whether the SQLs have correct formats.
The directories are for DBFlute tasks:
/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dfprop : Directory for DBFlute properties
extlib : Directory for Directory for library extension
log : Directory for log files of DBFlute tasks
output/doc : Directory for auto-generated documents
playsql : Directory for ReplaceSchema task
schema : Directory for files of schema info
- - - - - - - - - -/
The files, _project.bat, _project.sh, build.properties
are for internal processes of DBFlute tasks so basically
you don't need to touch them.

View file

@ -0,0 +1,5 @@
# -------------------------------------------------------------------
# P R O J E C T
# -------------------------------------------------------------------
torque.project = fess

View file

@ -0,0 +1,35 @@
Directory for DBFlute properties
Required (Basic) Properties:
o basicInfoMap.dfprop
o databaseInfoMap.dfprop
At first, you should set these properties
before executions of DBFlute tasks.
Properties for additional informations:
o additionalForeignKeyMap.dfprop
o additionalPrimaryKeyMap.dfprop
o additionalUniqueKeyMap.dfprop
o additionalTableMap.dfprop
Properties for implementation environments:
o commonColumnMap.dfprop
o classificationDefinitionMap.dfprop
o classificationDeploymentMap.dfprop
o optimisticLockDefinitionMap.dfprop
o outsideSqlDefinitionMap.dfprop
o sequenceDefinitionMap.dfprop
o dependencyInjectionMap.dfprop
o littleAdjustmentMap.dfprop
o includeQueryMap.dfprop
o typeMappingMap.dfprop
Properties for ReplaceSchema:
o replaceSchemaDefinitionMap.dfprop
Properties for documents:
o documentDefinitionMap.dfprop
Properties for non-functional adjustments:
o allClassCopyright.dfprop
o refreshDefinitionMap.dfprop

View file

@ -0,0 +1,42 @@
# /---------------------------------------------------------------------------
# additionalForeignKeyMap: (NotRequired - Default map:{})
#
# If foreign key does not exist in your database,
# you can set up here as virtual foreign key for DBFlute.
#
# And it's one-to-one relation if you add one fixed condition to referrer table,
# you can set virtual foreign key with fixedCondition and fixedSuffix.
# And you can use it to view objects too.
#
# If local column name is same as foreign column name,
# you can omit the setting of localColumnName and foreignColumnName.
# The names are treated as case insensitive.
#
# Example:
# map:{
# ; FK_MEMBER_MEMBER_STATUS_CODE = map:{
# ; localTableName = MEMBER ; foreignTableName = MEMBER_STATUS
# ; localColumnName = MEMBER_STATUS_CODE ; foreignColumnName = MEMBER_STATUS_CODE
# }
# ; FK_PURCHASE_MEMBER_ID = map:{
# ; localTableName = PURCHASE ; foreignTableName = MEMBER
# }
# ; FK_MEMBER_MEMBER_ADDRESS_VALID = map:{
# ; localTableName = MEMBER ; foreignTableName = MEMBER_ADDRESS
# ; localColumnName = MEMBER_ID ; foreignColumnName = MEMBER_ID
# ; fixedCondition =
# $$foreignAlias$$.VALID_BEGIN_DATE <= /*targetDate(Date)*/null
# and $$foreignAlias$$.VALID_END_DATE >= /*targetDate(Date)*/null
# ; fixedSuffix = AsValid
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
#; FK_MEMBER_MEMBER_STATUS_CODE = map:{
# ; localTableName = MEMBER ; foreignTableName = MEMBER_STATUS
# ; localColumnName = MEMBER_STATUS_CODE ; foreignColumnName = MEMBER_STATUS_CODE
#}
}
# ----------------/

View file

@ -0,0 +1,26 @@
# /---------------------------------------------------------------------------
# additionalPrimaryKeyMap: (NotRequired - Default map:{})
#
# If primary key does not exist in your database,
# you can set up here as virtual primary key for DBFlute.
# And you can use it to view objects too.
# The names are treated as case insensitive.
#
# Example:
# map:{
# ; PK_MEMBER = map:{
# ; tableName = MEMBER ; columnName = MEMBER_ID
# }
# ; PK_PURCHASE = map:{
# ; tableName = PURCHASE ; columnName = PURCHASE_ID
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
#; PK_MEMBER = map:{
# ; tableName = MEMBER ; columnName = MEMBER_ID
#}
}
# ----------------/

View file

@ -0,0 +1,42 @@
# /---------------------------------------------------------------------------
# additionalTableMap: (NotRequired - Default map:{})
#
# This property is valid at only JDBC task.
# You should use this when JDBC can not provide table information
# and when you have no table but call stored procedures only.
#
# The element 'columnMap' is only required in table elements.
# The element 'type' is only required in column elements.
#
# Specification:
# map: {
# [table-name] = map:{
# columnMap = map:{
# [column-name] = map:{
# type = [column JDBC type] ; dbType = [column DB type]
# ; required = [true or false] ; size = [column size]
# ; primaryKey = [true or false] ; pkName = [PK constraint name]
# ; autoIncrement = [true or false]
# ; default = [default value] ; comment = [column comment]
# }
# }
# ; comment = [table comment]
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
#; FOO_TABLE = map:{
# ; columnMap = map:{
# FOO_ID = map:{ type = INTEGER ; dbType = INTEGER
# ; required = true ; primaryKey = true ; autoIncrement = true
# }
# FOO_NAME = map:{ type = VARCHAR ; required = true ; size = 123 }
# FOO_DATE = map:{ type = DATE }
# }
#}
}
# ----------------/
#
# *Refer to typeMappingMap.dfprop for JDBC type reference.

View file

@ -0,0 +1,26 @@
# /---------------------------------------------------------------------------
# additionalUniqueKeyMap: (NotRequired - Default map:{})
#
# If unique key does not exist in your database,
# you can set up here as virtual unique key for DBFlute.
# And you can use it to view objects too.
# The names are treated as case insensitive.
#
# Example:
# map:{
# ; UQ_MEMBER = map:{
# ; tableName = MEMBER ; columnName = MEMBER_ACCOUNT
# }
# ; UQ_PRODUCT = map:{
# ; tableName = PRODUCT ; columnName = PRODUCT_HANDLE_CODE
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
#; UQ_MEMBER = map:{
# ; tableName = MEMBER ; columnName = MEMBER_ACCOUNT
#}
}
# ----------------/

View file

@ -0,0 +1,11 @@
# /---------------------------------------------------------------------------
# allClassCopyright: (NotRequired - Default '')
#
# The copyright for all classes.
# This property is NOT map style.
# You should specify before your first generating.
#
#/*
# * Copyright(c) DBFlute TestCo.,TestLtd. All Rights Reserved.
# */
# ----------------/

View file

@ -0,0 +1,228 @@
# /---------------------------------------------------------------------------
# basicInfoMap: (Required)
#
# The basic information for the tasks of DBFlute.
# You should specify before your first generating.
#
# Core Properties:
# o database: (Required)
# o targetLanguage: (Required)
# o targetContainer: (Required)
# o packageBase: (Required)
#
# Adjustment Properties:
# o generateOutputDirectory: (NotRequired - Default Java:'../src/main/java' CSharp:'../source')
# o resourceOutputDirectory: (NotRequired - Default '../resources')
# o isTableNameCamelCase: (NotRequired - Default false)
# o isColumnNameCamelCase: (NotRequired - Default false)
# o projectPrefix: (NotRequired - Default '')
# o classAuthor: (NotRequired - Default 'DBFlute(AutoGenerator)')
# o sourceFileEncoding: (NotRequired - Default 'UTF-8')
# o sourceCodeLineSeparator: (NotRequired - Default no setting)
# o applicationBehaviorMap: (NotRequired - Default map:{})
# o outputPackageAdjustmentMap: (NotRequired - Default map:{})
# o dbfluteSystemFinalTimeZone: (NotRequired - Default null)
#
# *The line that starts with '#' means comment-out.
#
map:{
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o database: (Required)
# This is the target database, only considered when generating
# the SQL for your DBFlute project.
# Your possible choices are:
#
# mysql, postgresql, oracle, db2, sqlserver,
# h2, derby, (sqlite, firebird, msaccess)
#
; database = h2
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o targetLanguage: (Required)
# The target language.
# Your possible choices are:
#
# java, csharp, scala
#
; targetLanguage = java
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o targetContainer: (Required)
# The target DI container.
# If your target language is 'csharp', you can specify 'seasar' only.
# Your possible choices are:
#
# spring, guice, seasar, cdi
#
; targetContainer = spring
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o packageBase: (Required)
# The base directory of package for generated class.
# The class package is 'this property value + detail package value'.
# However, detail packages have default value so basically
# you only have to specify the property 'packageBase'.
# If this property is specified and detail package properties is not specified,
# Then the packages of generated class are as follows:
#
# e.g. packageBase = org.docksidestage.dbflute
# --> org.docksidestage.dbflute.allcommon
# --> org.docksidestage.dbflute.bsbhv
# --> org.docksidestage.dbflute.bsentity
# --> org.docksidestage.dbflute.cbean
# --> org.docksidestage.dbflute.exbhv
# --> org.docksidestage.dbflute.exentity
#
; packageBase = org.codelibs.fess.db
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o generateOutputDirectory: (NotRequired - Default Java:'../src/main/java' CSharp:'../source')
# The base output directory for generating.
# Basically you don't need to specify this if the project style is as follows:
#
# *Java Project Style
# If this value is '../src/main/java' and your project is under the Maven,
# you don't need to set up this property!
#
# {app-project}
# |
# |-dbflute_[project]
# | |-dfprop
# | |-...
# |
# |-src/main/java // *Here!
# |-src/main/resources
# |-...
#
# *CSharp Project Style
# [app-solution]/dbflute_[project]/dfprop
# [app-solution]/mydbflute/dbflute-0.9.6
# [app-solution]/source/[app-solution].sln
# [app-solution]/source/[app-project(top-namespace)]/[part-namespace]/AllCommon
# [app-solution]/source/[app-project(top-namespace)]/[part-namespace]/BsBhv
# [app-solution]/source/[app-project(top-namespace)]/[part-namespace]/...
# [app-solution]/source/[app-project(top-namespace)]/Resources/...
#
#; generateOutputDirectory = ../src/main/java
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o resourceOutputDirectory: (NotRequired - Default '../resources')
# The base output directory for resource files that contain DI configurations.
# Basically you don't need to specify this if your project is under the Maven.
#
#; resourceOutputDirectory = ../resources
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isTableNameCamelCase: (NotRequired - Default false)
# Is the table name camel case?
# Basically you don't need this if the style of table name is like 'FOO_STATUS'.
# [true]
# The table name is camel case.
# e.g. If the table name is 'OrderDetail', the class name is 'OrderDetail'.
#
# [false]
# e.g. If the table name is 'ORDER_DETAIL', the class name is 'OrderDetail'.
# e.g. If the table name is 'OrderDetail', the class name is 'Orderdetail'.
#
#; isTableNameCamelCase = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isColumnNameCamelCase: (NotRequired - Default false)
# Is the column name camel case?
# Basically you don't need this if the style of column name is like 'FOO_NAME'.
# [true]
# The column name is camel case.
# e.g. If the column name is 'OrderDetailId', the class name is 'OrderDetailId'.
#
# [false]
# e.g. If the column name is 'ORDER_DETAIL_ID', the class name is 'OrderDetailId'.
# e.g. If the column name is 'OrderDetailId', the class name is 'Orderdetailid'.
#
#; isColumnNameCamelCase = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o projectPrefix: (NotRequired - Default '')
# If the value is 'Ld', all class names are 'LdXxx'.
# Basically you don't need this if you don't want the common prefix of class name.
#
#; projectPrefix = Ld
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o classAuthor: (NotRequired - Default 'DBFlute(AutoGenerator)')
# The value of the author tag in java-doc of generated classes.
# All classes are target.
#
#; classAuthor = DBFlute(AutoGenerator)
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o sourceFileEncoding: (NotRequired - Default 'UTF-8')
# The value of an encoding for source files that are generated classes.
# If source files of your project are not UTF-8, specify your encoding here.
#
#; sourceFileEncoding = UTF-8
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o sourceCodeLineSeparator: (NotRequired - Default no setting)
# The line separator setting for source code of generated classes.
# LF -> converted to LF
# CRLF -> converted to CRLF
# (no setting) -> no convert (template default is CRLF)
#
#; sourceCodeLineSeparator = LF
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o applicationBehaviorMap: (NotRequired - Default map:{})
# The settings for Application Behavior.
# Elements of this map are as below:
# o isApplicationBehaviorProject: (NotRequired - Default false)
# Does the project is for application behaviors?
# This property is a main signal for Application Behavior.
# Other properties (for Application Behavior) work when this is true.
# o libraryProjectPackageBase: (NotRequired - Default same as application's one)
# If application package base is different from library's one,
# set the property a value 'library's one'.
#
#; applicationBehaviorMap = map:{
# ; isApplicationBehaviorProject = false
# ; libraryProjectPackageBase =
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o outputPackageAdjustmentMap: (NotRequired - Default map:{})
# The adjustments for output package.
# Elements of this map are as below:
# o flatDirectoryPackage: (Required - Default '')
# This is only for CSharp.
# e.g. Aaa.Bbb.DBFlute --> Directory: source/Aaa.Bbb.DBFlute/AllCommon
# o omitDirectoryPackage: (NotRequired - Default '')
# This is only for CSharp.
# e.g. Aaa --> Directory: source/Bbb/DBFlute/AllCommon
#
#; outputPackageAdjustmentMap = map:{
# ; flatDirectoryPackage = Aaa.Bbb.DBFlute
# ; omitDirectoryPackage = Aaa
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteSystemFinalTimeZone: (NotRequired - Default null)
# The ID of time-zone for DBFlute system.
# basically for e.g. DisplaySql, Date conversion, LocalDate mapping and so on...
#
#; dbfluteSystemFinalTimeZone = GMT
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,56 @@
# /---------------------------------------------------------------------------
# classificationDefinitionMap: (NotRequired - Default map:{})
#
# The definition of classification.
#
# Specification:
# map: {
# [classification-name] = list:{
# ; map:{
# ; topComment=[comment]; codeType=[String(default) or Number or Boolean]}
# ; undefinedHandlingType=[EXCEPTION or LOGGING(default) or ALLOWED]
# ; isUseDocumentOnly=[true or false(default)]
# ; isSuppressAutoDeploy=[true or false(default)]
# ; groupingMap = map:{
# ; [group-name] = map:{
# ; groupComment=[comment]
# ; elementList=list:{[the list of classification element's name]}
# }
# }
# }
# # classification elements for implicit classification
# ; map:{
# ; code=[code]; name=[name]; alias=[alias]; comment=[comment]
# ; sisterCode=[code or code-list]; subItemMap=map:{[free-map]}
# }
# # settings for table classification
# ; map:{
# ; table=[table-name]
# ; code=[column-name for code]; name=[column-name for name]
# ; alias=[column-name for alias]; comment=[column-name for comment]}
# ; where=[condition for select]; orderBy=[column-name for ordering]
# ; exceptCodeList=[the list of except code]
# }
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
# example for implicit classification
#; Flg = list:{
# ; map:{topComment=general boolean classification for every flg-column; codeType=Number}
# ; map:{code=1; name=True ; alias=Checked ; comment=means yes; sisterCode=true}
# ; map:{code=0; name=False; alias=Unchecked; comment=means no ; sisterCode=false}
#}
# example for table classification
#; MemberStatus = list:{
# ; map:{topComment=status of member from entry to withdrawal; codeType=String}
# ; map:{
# ; table=MEMBER_STATUS
# ; code=MEMBER_STATUS_CODE; name=MEMBER_STATUS_NAME
# ; comment=DESCRIPTION; orderBy=DISPLAY_ORDER
# }
#}
}
# ----------------/

View file

@ -0,0 +1,25 @@
# /---------------------------------------------------------------------------
# classificationDeploymentMap: (NotRequired - Default map:{})
#
# The relation between column and classification.
#
# This property uses classification names of classificationDefinitionMap.
# The table name '$$ALL$$' means all tables are target.
# The table names and column names are treated as case insensitive.
#
# You don't need specify here about table classifications.
# Because table classifications are auto-deployed by relation information.
#
# Specification:
# map: {
# [table-name or $$ALL$$] = map:{
# ; [column-name (with hint)]=[classification-name]
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
#; $$ALL$$ = map:{suffix:_FLG=Flg}
}
# ----------------/

View file

@ -0,0 +1,49 @@
# /---------------------------------------------------------------------------
# commonColumnMap: (Default map:{})
#
# The definition of common column(contains auto set-up).
# For example, the date you registered the record,
# the user who updated the record and so on...
# The column names are treated as case insensitive.
#
# The variable '$$AccessContext$$' means allcommon.AccessContext.
#
# Example:
# map:{
# ; commonColumnMap = map:{
# ; REGISTER_DATETIME=TIMESTAMP ; REGISTER_USER=VARCHAR
# ; UPDATE_DATETIME=TIMESTAMP ; UPDATE_USER=VARCHAR
# }
# ; beforeInsertMap = map:{
# ; REGISTER_DATETIME = $$AccessContext$$.getAccessLocalDateTimeOnThread()
# ; REGISTER_USER = $$AccessContext$$.getAccessUserOnThread()
# ; UPDATE_DATETIME = entity.getRegisterDatetime()
# ; UPDATE_USER = entity.getRegisterUser()
# }
# ; beforeUpdateMap = map:{
# ; UPDATE_DATETIME = $$AccessContext$$.getAccessLocalDateTimeOnThread()
# ; UPDATE_USER = $$AccessContext$$.getAccessUserOnThread()
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
#; commonColumnMap = map:{
# ; REGISTER_DATETIME=TIMESTAMP ; REGISTER_USER=VARCHAR
# ; UPDATE_DATETIME=TIMESTAMP ; UPDATE_USER=VARCHAR
#}
#; beforeInsertMap = map:{
# ; REGISTER_DATETIME = $$AccessContext$$.getAccessLocalDateTimeOnThread()
# ; REGISTER_USER = $$AccessContext$$.getAccessUserOnThread()
# ; UPDATE_DATETIME = entity.getRegisterDatetime()
# ; UPDATE_USER = entity.getRegisterUser()
#}
#; beforeUpdateMap = map:{
# ; UPDATE_DATETIME = $$AccessContext$$.getAccessLocalDateTimeOnThread()
# ; UPDATE_USER = $$AccessContext$$.getAccessUserOnThread()
#}
}
# ----------------/
#
# *Refer to typeMappingMap.dfprop for JDBC type reference.

View file

@ -0,0 +1,112 @@
# /---------------------------------------------------------------------------
# databaseInfoMap: (Required)
#
# The database information for the tasks of DBFlute.
# You should specify before your first generating.
#
# o driver -- The class name of JDBC-Driver.
# o url -- The URL for connecting database.
# o schema -- The schema name.
# o user -- The database user name.
# o password -- The database password.
# o propertiesMap -- The properties that depends on the database.
# o variousMap -- The various settings about JDBC task.
#
# *The line that starts with '#' means comment-out.
#
map:{
; driver = org.h2.Driver
; url = jdbc:h2:file:../src/main/resources/fess
; schema =
; user = sa
; password =
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o propertiesMap: (NotRequired - Default map:{})
# The properties that depends on the database.
#
; propertiesMap = map:{
# If you use Oracle and its Synonym, specify this property.
#; includeSynonyms=true
}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o variousMap: (NotRequired - Default map:{})
# The various settings about JDBC task mainly.
#
; variousMap = map:{
# o objectTypeTargetList: (NotRequired - Default list:{TABLE;VIEW})
# If you want to include other object types in generating target,
# you should specify the list of included object types as adding.
# e.g. Synonym of Oracle --> list:{TABLE ; VIEW ; SYNONYM}
# This is only for the main schema. Additional schemas are unconcerned.
# However ReplaceSchema and Sql2Entity task also uses this.
# But you can set ReplaceSchema-original setting in its own dfprop.
#
#; objectTypeTargetList = list:{TABLE ; VIEW}
# o tableExceptList: (NotRequired - Default list:{})
# If you want to exclude some tables in generating target,
# you should specify the list of excepted table hints.
# e.g. list:{PRODUCT_STATUS ; prefix:TMP_}
# This is only for the main schema. Additional schemas are unconcerned.
# And ReplaceSchema task basically ignores this.
#
# Normally this 'except' means no getting meta data for excepted tables.
# (so the tables are not existing in SchemaHTML and HistoryHTML and so on).
# But you can specify the '@gen' suffix that means generate-only except.
# A table with the mark can be treated as documents but no generating classes.
#
#; tableExceptList = list:{FOO_TABLE@gen ; prefix:FOO_@gen ; suffix:_FOO ; contain:_FOO_}
# o tableTargetList: (NotRequired - Default list:{})
# If you want to include some tables in generating target expressly,
# you should specify the list of target table hints.
# e.g. list:{PURCHASE ; contain:MEMBER}
# This is only for the main schema. Additional schemas are unconcerned.
# And ReplaceSchema task basically ignores this.
#
#; tableTargetList = list:{FOO_TABLE ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# o columnExceptMap: (NotRequired - Default map:{})
# If you want to exclude some columns in generating target,
# you should specify the list of excepted column hints.
# e.g. map:{HEAVY_MASTER = list:{APP_NOT_USED_ID; suffix:_IMAGE}}
# This is only for the main schema. Additional schemas are unconcerned.
#
#; columnExceptMap = map:{
# ; FOO_TABLE = list:{FOO_COLUMN ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
#}
# o additionalSchemaMap: (NotRequired - Default map:{})
# If you want to include other schemas in generating target,
# you should specify the map of included schemas.
# Additional schemas have original settings apart from the main schema.
# The settings are objectTypeTargetList, tableExceptList,
# tableTargetList, and columnExceptMap.
# They have the same specification as ones of the main schema.
# Elements of this map are as below:
# o objectTypeTargetList: (NotRequired - Default 'map:{TABLE;VIEW}')
# o tableExceptList: (NotRequired - Default list:{})
# o tableTargetList: (NotRequired - Default list:{})
# o columnExceptMap: (NotRequired - Default map:{})
# o isSuppressCommonColumn: (NotRequired - Default false)
# o isSuppressProcedure: (NotRequired - Default false)
#
#; additionalSchemaMap = map:{
# ; NEXTEXAMPLEDB = map:{
# ; objectTypeTargetList=list:{TABLE ; VIEW}
# ; tableExceptList=list:{FOO_TABLE ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# ; tableTargetList=list:{FOO_TABLE ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# ; columnExceptMap=map:{
# ; FOO_TABLE = list:{FOO_COLUMN ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# }
# ; isSuppressCommonColumn=false
# ; isSuppressProcedure=false
# }
#}
}
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,125 @@
# /---------------------------------------------------------------------------
# dependencyInjectionMap: (NotRequired - Default map:{})
#
# The various settings about dependency injection(DI Container).
#
# {Java} Seasar Only:
# o dbfluteDiconNamespace: (NotRequired - Default 'dbflute')
# o dbfluteDiconPackageName (NotRequired - Default '../resources')
# o dbfluteDiconFileName: (NotRequired - Default 'dbflute.dicon')
# o j2eeDiconResourceName: (NotRequired - Default 'j2ee.dicon')
# o dbfluteDiconBeforeJ2eeIncludeDefinitionMap: (NotRequired - Default map:{})
# o dbfluteDiconOtherIncludeDefinitionMap: (NotRequired - Default map:{})
#
# {Java} Spring Only:
# o dbfluteBeansPackageName (NotRequired - Default '../resources')
# o dbfluteBeansFileName: (NotRequired - Default 'dbfluteBeans.xml')
# o dbfluteBeansDataSourceName: (NotRequired - Default 'dataSource')
# o dbfluteBeansDefaultAttribute: (NotRequired - Default null)
# o isDBFluteBeansGeneratedAsJavaConfig (NotRequired - Default true since 1.1)
#
# {CSharp} Quill(CSharp Seasar) Only:
# o quillDataSourceName: (NotRequired - Default null)
#
# *The line that starts with '#' means comment-out.
#
map:{
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteDiconNamespace: (NotRequired - Default 'dbflute')
# The namespace of DBFlute DI configuration.
#
# @SeasarOnly
#; dbfluteDiconNamespace = dbflute
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteDiconPackageName (NotRequired - Default '../resources')
# The package name(output directory) of DBFlute DI configuration for Seasar.
#
# @SeasarOnly
#; dbfluteDiconPackageName = ../resources
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteDiconFileName: (NotRequired - Default 'dbflute.dicon')
# The file name of DBFlute DI configuration for Seasar.
#
# @SeasarOnly
#; dbfluteDiconFileName = dbflute.dicon
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o j2eeDiconResourceName: (NotRequired - Default 'j2ee.dicon')
# The file name of J2EE DI configuration.
#
# @SeasarOnly
#; j2eeDiconResourceName = j2ee.dicon
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteDiconBeforeJ2eeIncludeDefinitionMap: (NotRequired - Default map:{})
# The include definition of DBFlute DI configuration before j2ee including.
# e.g. map:{ jdbc-xxx.dicon = dummy }
#
# @SeasarOnly
#; dbfluteDiconBeforeJ2eeIncludeDefinitionMap = map:{}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteDiconOtherIncludeDefinitionMap: (NotRequired - Default map:{})
# The other include definition of DBFlute DI configuration.
# e.g. map:{ common.dicon = dummy }
#
# @SeasarOnly
#; dbfluteDiconOtherIncludeDefinitionMap = map:{}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteBeansPackageName (NotRequired - Default '../resources')
# The package name(output directory) of DBFlute DI configuration for Spring and Lucy.
#
# @SpringOnly
#; dbfluteBeansPackageName = ../resources
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteBeansFileName: (NotRequired - Default 'dbfluteBeans.xml')
# The file name of DBFlute DI configuration for Spring and Lucy.
#
# @SpringOnly
#; dbfluteBeansFileName = dbfluteBeans.xml
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteBeansDataSourceName: (NotRequired - Default 'dataSource')
# The data source name that DBFlute(Behaviors) uses.
#
# @SpringOnly
#; dbfluteBeansDataSourceName = exampleDataSource
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o dbfluteBeansPackageName (NotRequired - Default null)
# The default attribute expression of DBFlute DI configuration for Spring and Lucy.
#
# @SpringOnly
#; dbfluteBeansDefaultAttribute = default-lazy-init="true"
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isDBFluteBeansGeneratedAsJavaConfig (NotRequired - Default true since 1.1)
# Does it generate JavaConfig for DBFluteBeans? (not use XML configuration)
#
# @SpringOnly
#; isDBFluteBeansGeneratedAsJavaConfig = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o quillDataSourceName: (NotRequired - Default null)
# The data source name of Quill(CSharp Seasar).
#
# @QuillOnly
#; quillDataSourceName = ExampleDB
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,225 @@
# /---------------------------------------------------------------------------
# documentDefinitionMap: (NotRequired - Default map:{})
#
# o documentOutputDirectory (NotRequired - Default './output/doc')
# o aliasDelimiterInDbComment (NotRequired - Default '')
# o isDbCommentOnAliasBasis (NotRequired - Default false)
# o isEntityJavaDocDbCommentValid (NotRequired - Default true)
# o isEntityDBMetaDbCommentValid (NotRequired - Default false)
# o schemaHtmlFileName (NotRequired - Default 'schema-[project-name].html')
# o isSuppressSchemaHtmlOutsideSql (NotRequired - Default false)
# o isSuppressSchemaHtmlProcedure (NotRequired - Default false)
# o historyHtmlFileName (NotRequired - Default 'history-[project-name].html')
# o isCheckColumnDefOrderDiff (NotRequired - Default false)
# o isCheckDbCommentDiff (NotRequired - Default false)
# o isCheckProcedureDiff (NotRequired - Default false)
# o loadDataReverseMap (NotRequired - Default map:{})
# o schemaSyncCheckMap (NotRequired - Default map:{})
# o propertiesHtmlMap: (NotRequired - Default map:{})
#
# Example:
# map:{
# ; documentOutputDirectory = ./output/doc
# ; aliasDelimiterInDbComment = :
# ; isDbCommentOnAliasBasis = true
# ; isEntityJavaDocDbCommentValid = true
# ; isEntityDBMetaDbCommentValid = true
# ; schemaHtmlFileName = xxx.html
# ; isSuppressSchemaHtmlOutsideSql = false
# ; isSuppressSchemaHtmlProcedure = false
# ; historyHtmlFileName = xxx.html
# ; isCheckColumnDefOrderDiff = true
# ; isCheckDbCommentDiff = true
# ; isCheckProcedureDiff = true
# ; loadDataReverseMap = map:{
# ; recordLimit = -1
# ; isReplaceSchemaDirectUse = true
# ; isOverrideExistingDataFile = false
# ; isSynchronizeOriginDate = false
# }
# ; schemaSyncCheckMap = map:{
# ; url = jdbc:...
# ; schema = EXAMPLEDB
# ; user = exampuser
# ; password = exampword
# }
# ; propertiesHtmlMap = map:{
# ; ApplicationProperties = map:{
# ; rootFile = ../src/main/resources/application_ja.properties
# }
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o documentOutputDirectory (NotRequired - Default './output/doc')
# The output directory mainly for SchemaHtml and DataXlsTemplate.
# Basically you don't need this.
# It is considered of value that it always exists at same plain.
#
#; documentOutputDirectory = ./output/doc
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o aliasDelimiterInDbComment (NotRequired - Default '')
# If the alias exists in its DB comment like as follows:
# member name : The name of member's full name
# you can use the alias in DBFlute world, java-doc, SchemaHTML...
# DB comment which does not have the delimiter is not treated
# as alias, treated as description (real comment).
# But you can change it by 'isDbCommentOnAliasBasis'.
#
#; aliasDelimiterInDbComment = :
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isDbCommentOnAliasBasis (NotRequired - Default false)
# Is DB comment on alias basis?
# (Is DB comment alias name when it has no alias delimiter?)
# This property works with 'aliasDelimiterInDbComment'.
#
#; isDbCommentOnAliasBasis = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isEntityJavaDocDbCommentValid (NotRequired - Default true)
# Does it allow DB comment to be on java-doc?
#
#; isEntityJavaDocDbCommentValid = true
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isEntityDBMetaDbCommentValid (NotRequired - Default false)
# Does it allow DB comment to be on DB meta of entity?
#
#; isEntityDBMetaDbCommentValid = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o schemaHtmlFileName (NotRequired - Default 'schema-[project-name].html')
# The file name (not contain path) of SchemaHtml.
# Basically you don't need this.
# (For example, when you use Application Behavior, you need this)
#
#; schemaHtmlFileName = xxx.html
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressSchemaHtmlOutsideSql (NotRequired - Default false)
# Does it remove outsideSql information from SchemaHtml?
# Basically you don't need this.
# OutsideSql information (related to tables) is very useful.
#
#; isSuppressSchemaHtmlOutsideSql = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressSchemaHtmlProcedure (NotRequired - Default false)
# Does it remove procedure information from SchemaHtml?
# Basically you don't need this.
# Procedure information is very useful.
#
#; isSuppressSchemaHtmlProcedure = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o historyHtmlFileName (NotRequired - Default 'history-[project-name].html')
# The file name (not contain path) of HistoryHtml.
# Basically you don't need this.
# (For example, when you use Application Behavior, you need this)
#
#; historyHtmlFileName = xxx.html
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isCheckColumnDefOrderDiff (NotRequired - Default false)
# Does it check differences of column-def order?
# (except added or deleted columns)
#
#; isCheckColumnDefOrderDiff = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isCheckDbCommentDiff (NotRequired - Default false)
# Does it check differences of table or column or others comment?
#
#; isCheckDbCommentDiff = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isCheckProcedureDiff (NotRequired - Default false)
# Does it check differences of procedures?
#
#; isCheckProcedureDiff = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o loadDataReverseMap: (NotRequired - Default map:{})
# You can set LoadDataReverse settings.
# This property is valid when the property 'recordLimit' is set.
# Elements of this map are as below:
# o recordLimit: The limit of records to output. Minus means no limit. (NotRequired - Default '')
# o isReplaceSchemaDirectUse: Does it output the data to playsql directly? (NotRequired - Default false)
# o isOverrideExistingDataFile: Does it output to existing files? (NotRequired - Default false)
# o isSynchronizeOriginDate: Does it synchronize origin date for date adjustment? (NotRequired - Default false)
#
; loadDataReverseMap = map:{
; recordLimit = -1
; isReplaceSchemaDirectUse = true
; isOverrideExistingDataFile = false
; isSynchronizeOriginDate = false
}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o schemaSyncCheckMap: (NotRequired - Default map:{})
# You can set SchemaSyncCheck settings.
# This property is valid when the property 'user' is set.
# Elements of this map are as below:
# o url: The URL for connecting database. (NotRequired - Default same as databaseInfoMap)
# o schema: The schema name. (NotRequired - Default '' e.g. no setting when MySQL)
# o user: The database user name. (Required)
# o password: The database password. (NotRequired - Default '')
#
#; schemaSyncCheckMap = map:{
# ; url = jdbc:...
# ; schema = EXAMPLEDB
# ; user = exampuser
# ; password = exampword
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o propertiesHtmlMap: (NotRequired - Default map:{})
# You can set PropertiesHtml settings.
# Elements of this map are as below:
# o key of map: Properties Title Name
# o baseDir: base directory for directory property. (NotRequired)
# o rootFile: root file to read properties (Required)
# o environmentMap: map of environment files, the value is dir path (NotRequired)
# o diffIgnoredKeyList: list of ignored keys for differences (NotRequired)
# o maskedKeyList: list of masked keys for security (NotRequired)
# o isEnvOnlyFloatLeft: is it environment only? (and show as float-left?) (NotRequired)
# o extendsPropRequest: other request name of exnteds-properties (NotRequired)
# o isCheckImplicitOverride: does it check implicit override? (NotRequired)
#
#; propertiesHtmlMap = map:{
# ; ApplicationProperties = map:{
# ; baseDir = ../src
# ; rootFile = $$baseDir$$/main/resources/application_ja.properties
# ; environmentMap = map:{
# ; integration = $$baseDir$$/integration/resources
# ; production = $$baseDir$$/production/resources
# }
# ; diffIgnoredKeyList = list:{}
# ; maskedKeyList = list:{}
# ; isEnvOnlyFloatLeft = false
# ; extendsPropRequest = null
# ; isCheckImplicitOverride = false
# }
#}
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,29 @@
map:{
; ElasticsearchBeanGen = map:{
; resourceMap = map:{
; resourceType = ELASTICSEARCH
; resourceFile = ../src/main/config/es/fess_config.json
}
; outputMap = map:{
; templateFile = unused
; outputDirectory = ../src/main/java
; package = org.codelibs.fess.es
; className = unused
}
; tableMap = map:{
; tablePath = .fess_config -> mappings -> map
; mappingMap = map:{
; type = map:{
; string = String
; integer = Integer
; long = Long
; float = Float
; double = Double
; boolean = Boolean
; date = java.time.LocalDateTime
}
}
}
}
}

View file

@ -0,0 +1,99 @@
# /---------------------------------------------------------------------------
# includeQueryMap: (NotRequired - Default map:{})
#
# Specification:
# map:{
# ; [property-type] = map:{
# ; [condition-key] = map:{ [table] = list:{ [column] ; [column] } }
# }
#
# property-type: String, Number, Date, OrderBy, ...
# condition-key: NotEqual, GreaterThan, LessThan, GreaterEqual, LessEqual
# , InScope, NotInScope, PrefixSearch, LikeSearch, NotLikeSearch
# , EmptyString, FromTo, DateFromTo, RangeOf, ...
# , (and prefix '!' means excluding, '%' means reviving)
# table: table name (hint) or $$ALL$$
# column: column name (hint) or $$CommonColumn$$ or $$VersionNo$$
#
# Example:
# map:{
# # This means that String includes GreaterThan at MEMBER.MEMBER_ACCOUNT only
# # and LessThan at PRODUCT.PRODUCT_NAME and PRODUCT.PRODUCT_HANDLE_CODE,
# # and InScope for LONGVARCHAR(e.g. text type) is excluded.
# ; String = map:{
# ; GreaterThan = map:{ MEMBER = list:{ MEMBER_ACCOUNT } }
# ; LessThan = map:{ PRODUCT = list:{ PRODUCT_NAME ; PRODUCT_HANDLE_CODE } }
# ; !InScope = map:{ $$ALL$$ = list:{ type:LONGVARCHAR } }
# }
# # This means that Number excludes all version-no's NotEqual.
# ; Number = map:{
# ; !NotEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
# }
# # This means that Date does not includes NotEqual at all tables.
# ; Date = map:{
# ; NotEqual = map:{}
# }
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
; String = map:{
# [Include]
# String columns may not be needed
# to be set these condition-keys basically.
#; GreaterThan = map:{}
#; LessThan = map:{}
#; GreaterEqual = map:{}
#; LessEqual = map:{}
# [Exclude]
# Common columns of String type may not be needed
# to be set these condition-keys basically.
#; !NotEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !GreaterThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !LessThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !GreaterEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !LessEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !InScope = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !NotInScope = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !PrefixSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !LikeSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !NotLikeSearch = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
}
; Number = map:{
# [Include]
# ...
# [Exclude]
# VersionNo column may not be needed
# to be set these condition-keys basically.
#; !NotEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
#; !GreaterThan = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
#; !LessThan = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
#; !GreaterEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
#; !LessEqual = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
#; !RangeOf = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
#; !InScope = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
#; !NotInScope = map:{ $$ALL$$ = list:{ $$VersionNo$$ } }
}
; Date = map:{
# [Include]
# Date columns may not be needed
# to be set these condition-keys basically.
; NotEqual = map:{}
; InScope = map:{}
; NotInScope = map:{}
# [Exclude]
# Common columns of Date type may not be needed
# to be set these condition-keys basically.
#; !GreaterThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !LessThan = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !GreaterEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !LessEqual = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !FromTo = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
#; !DateFromTo = map:{ $$ALL$$ = list:{ $$CommonColumn$$ } }
}
}
# ----------------/

View file

@ -0,0 +1,282 @@
# /---------------------------------------------------------------------------
# littleAdjustmentMap: (NotRequired - Default map:{})
#
# The various settings about a little adjustment.
#
# o isAvailableAddingSchemaToTableSqlName: (NotRequired - Default false)
# o isAvailableAddingCatalogToTableSqlName: (NotRequired - Default false)
# o isAvailableDatabaseDependency: (NotRequired - Default false)
# o isAvailableDatabaseNativeJDBC: (NotRequired - Default false)
# o isAvailableNonPrimaryKeyWritable: (NotRequired - Default false)
# o classificationUndefinedHandlingType: (NotRequired - Default LOGGING)
# o isEntityConvertEmptyStringToNull: (NotRequired - Default false)
# o isMakeConditionQueryEqualEmptyString: (NotRequired - Default false)
# o isTableDispNameUpperCase: (NotRequired - Default false)
# o isTableSqlNameUpperCase: (NotRequired - Default false)
# o isColumnSqlNameUpperCase: (NotRequired - Default false)
# o isMakeDeprecated: (NotRequired - Default false)
# o isMakeRecentlyDeprecated: (NotRequired - Default true)
# o extendedDBFluteInitializerClass: (NotRequired - Default null)
# o extendedImplementedInvokerAssistantClass: (NotRequired - Default null)
# o extendedImplementedCommonColumnAutoSetupperClass: (NotRequired - Default null)
# o shortCharHandlingMode: (NotRequired - Default NONE)
# o quoteTableNameList: (NotRequired - Default list:{})
# o quoteColumnNameList: (NotRequired - Default list:{})
# o columnNullObjectMap: (NotRequired - Default map:{})
# o relationalNullObjectMap: (NotRequired - Default map:{})
# o cursorSelectFetchSize: (NotRequired - Default null)
#
# *The line that starts with '#' means comment-out.
#
map:{
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isAvailableAddingSchemaToTableSqlName: (NotRequired - Default false)
# [true]
# Add schema to table SQL name. (The table name on query is SCHEMA.TABLE)
#
# [false]
# Non.
#
#; isAvailableAddingSchemaToTableSqlName = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isAvailableAddingCatalogToTableSqlName: (NotRequired - Default false)
# [true]
# Add catalog to table SQL name. (The table name on query is CATALOG.SCHEMA.TABLE)
# This property works only when isAvailableAddingSchemaToTableSqlName is true.
#
# [false]
# Non.
#
#; isAvailableAddingCatalogToTableSqlName = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isAvailableDatabaseDependency: (NotRequired - Default false)
# [true]
# Generate the method that depends on the database.
# For example: cb.lockWithRR() at DB2.
#
# [false]
# Non.
#
#; isAvailableDatabaseDependency = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isAvailableDatabaseNativeJDBC: (NotRequired - Default false)
# [true]
# Use classes of database native JDBC on generated classes
# to get best performances of DB access.
# Your project needs to refer to database native JDBC.
#
# [false]
# Non.
#
#; isAvailableDatabaseNativeJDBC = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isAvailableNonPrimaryKeyWritable: (NotRequired - Default false)
# [true]
# Generate writable methods at non-primary-key table.
#
# [false]
# Non.
#
#; isAvailableNonPrimaryKeyWritable = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o classificationUndefinedHandlingType: (NotRequired - Default LOGGING)
# The handling type when undefined classification is found.
#
# EXCEPTION - throws exception when found
# LOGGING - logging only when found (exception if ReplaceSchema)
# ALLOWED - no action
#
#; classificationUndefinedHandlingType = LOGGING
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isEntityConvertEmptyStringToNull: (NotRequired - Default false)
# [true]
# Convert empty-string data to null in entity.
#
# [false]
# Non.
#
#; isEntityConvertEmptyStringToNull = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isMakeConditionQueryEqualEmptyString: (NotRequired - Default false)
# [true]
# Make equal-empty-string methods of condition-query.
# For example: cb.query().setMemberName_Equal_EmptyString()
#
# [false]
# Non.
#
#; isMakeConditionQueryEqualEmptyString = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isTableDispNameUpperCase: (NotRequired - Default false)
# [true]
# Table names for display, e.g. on documents,
# are forcedly treated as upper case.
#
# [false]
# Non.
#
#; isTableDispNameUpperCase = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isTableSqlNameUpperCase: (NotRequired - Default false)
# [true]
# Table names on SQL executed by condition-bean or behavior
# are forcedly treated as upper case. (except outside-SQL)
#
# [false]
# Non.
#
#; isTableSqlNameUpperCase = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isColumnSqlNameUpperCase: (NotRequired - Default false)
# [true]
# Column names on SQL executed by condition-bean or behavior
# are forcedly treated as upper case. (except outside-SQL)
#
# [false]
# Non.
#
#; isColumnSqlNameUpperCase = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isMakeDeprecated: (NotRequired - Default false)
# [true]
# Make deprecated method and class and so on...
# *You should specify this property 'false'!
#
# [false]
# Non.
#
#; isMakeDeprecated = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isMakeRecentlyDeprecated: (NotRequired - Default true)
# [true]
# Make RECENTLY deprecated method and class and so on...
# *You should specify this property 'false'!
#
# [false]
# Non.
#
#; isMakeRecentlyDeprecated = true
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o extendedDBFluteInitializerClass: (NotRequired - Default null)
# If you want to extend the embedded DBFlute initializer,
# specify the class name of your original initializer
# that extends the embedded one.
# *Basically for fixed DBFluteConfig settings
#
#; extendedDBFluteInitializerClass = com.example.ExtendedDBFluteInitializer
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o extendedImplementedInvokerAssistantClass: (NotRequired - Default null)
# If you want to extend the embedded invoker assistant,
# specify the class name of your original invoker assistant
# that extends the embedded one.
# *Basically you SHOULD NOT specify this property!
#
#; extendedImplementedInvokerAssistantClass = com.example.ExtendedImplementedInvokerAssistant
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o extendedImplementedCommonColumnAutoSetupperClass: (NotRequired - Default null)
# If you want to extend the embedded common column auto setupper,
# specify the class name of your original common column auto setupper
# that extends the embedded one.
# *Basically you SHOULD NOT specify this property!
#
#; extendedImplementedCommonColumnAutoSetupperClass = com.example.ExtendedImplementedCommonColumnAutoSetupper
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o shortCharHandlingMode: (NotRequired - Default NONE)
# If the parameter of condition-bean or parameter-bean has short size,
# NONE - Do nothing. (default)
# EXCEPTION - It throws an exception.
# RFILL - It fills the parameter by right spaces.
# LFILL - It fills the parameter by left spaces.
#
#; shortCharHandlingMode = NONE
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o quoteTableNameList: (NotRequired - Default list:{})
# The list of table DB names that need to be quoted.
# Specified tables is quoted on auto-generated SQL.
#
#; quoteTableNameList = list:{}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o quoteColumnNameList: (NotRequired - Default list:{})
# The list of column DB names that need to be quoted.
# Specified columns is quoted on auto-generated SQL.
#
#; quoteColumnNameList = list:{}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o columnNullObjectMap: (NotRequired - Default map:{})
# You can get a null object when the column is null.
#
#; columnNullObjectMap = map:{
# ; providerPackage = $$packageBase$$.nogen.cache
# ; isGearedToSpecify = true
# ; columnMap = map:{
# ; MEMBER_STATUS = map:{
# ; DESCRIPTION = CachedMemberStatus.get(this, "$$columnName$$", $$primaryKey$$)
# }
# ; MEMBER_SECURITY = map:{
# ; REMINDER_ANSWER = CachedMemberSecurity.get(this, "$$columnName$$", $$primaryKey$$)
# ; REMINDER_QUESTION = CachedMemberSecurity.get(this, "$$columnName$$", $$primaryKey$$)
# }
# }
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o relationalNullObjectMap: (NotRequired - Default map:{})
# You can get a null object when the relation is null.
#
#; relationalNullObjectMap = map:{
# ; providerPackage = $$packageBase$$.nogen.cache
# ; foreignMap = map:{
# ; MEMBER_STATUS = CachedMemberStatus.get(this, "$$foreignPropertyName$$", $$primaryKey$$)
# ; MEMBER_SECURITY = CachedMemberSecurity.get(this, "$$foreignPropertyName$$", $$primaryKey$$)
# }
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o cursorSelectFetchSize: (NotRequired - Default null)
# The fetch size of JDBC parameter for cursor select.
# For example, specify Integer.MIN_VALUE to enable fetch of MySQL.
#
#; cursorSelectFetchSize = Integer.MIN_VALUE
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,28 @@
# /---------------------------------------------------------------------------
# optimisticLockDefinitionMap: (NotRequired - Default map:{})
#
# The definition for optimistic lock of DBFlute.
#
# o updateDateFieldName: (NotRequired - Default '')
# o versionNoFieldName: (NotRequired - Default 'VERSION_NO')
#
# *The line that starts with '#' means comment-out.
#
map:{
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o updateDateFieldName: (NotRequired - Default '')
# The column name of update date for optimistic lock.
#
#; updateDateFieldName = UPDATE_DATE
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o versionNoFieldName: (NotRequired - Default 'VERSION_NO')
# The column name of version no for optimistic lock.
# Basically you don't need this if your tables have the column 'VERSION_NO'.
# because the default value is 'VERSION_NO'.
#
#; versionNoFieldName = VERSION_NO
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,187 @@
# /---------------------------------------------------------------------------
# outsideSqlDefinitionMap: (NotRequired - Default map:{})
#
# The various settings about outsideSql.
#
# o isGenerateProcedureParameterBean: (NotRequired - Default false)
# o isGenerateProcedureCustomizeEntity: (NotRequired - Default false)
# o targetProcedureCatalogList: (NotRequired - Default list:{})
# o targetProcedureSchemaList: (NotRequired - Default list:{})
# o targetProcedureNameList: (NotRequired - Default list:{})
# o executionMetaProcedureNameList: (NotRequired - Default list:{})
# o procedureSynonymHandlingType: (NotRequired - Default NONE)
# o isRequiredSqlTitle: (NotRequired - Default true)
# o isRequiredSqlDescription: (NotRequired - Default true)
# o sqlFileEncoding: (NotRequired - Default 'UTF-8')
# o sqlDirectory: (NotRequired - Default generateOutputDirectory & resourceOutputDirectory)
# o sql2EntityOutputDirectory: (NotRequired - Default generateOutputDirectory)
# o applicationOutsideSqlMap: (NotRequired - Default map:{})
# o sqlPackage: (NotRequired - Default all packages)
#
# *The line that starts with '#' means comment-out.
#
map:{
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isGenerateProcedureParameterBean: (NotRequired - Default false)
# [true]
# The parameter beans for procedure are auto-generated.
# If you call the procedure from DBFlute, you should specify 'true'!
#
# [false]
# Non.
#
; isGenerateProcedureParameterBean = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isGenerateProcedureCustomizeEntity: (NotRequired - Default false)
# [true]
# The customize entities for procedure's out-parameter
# and not-param-result are auto-generated.
# And also not-param-result's properties are auto-generated.
# Target procedures are executed actually at Sql2Entity task.
# (because of getting from execution meta data (result set meta data))
# This property is valid only when isGenerateProcedureParameterBean is true.
#
# [false]
# Non.
#
; isGenerateProcedureCustomizeEntity = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o targetProcedureCatalogList: (NotRequired - Default list:{})
# You can specify target catalog of generated parameter bean for procedure.
# This property is valid only when generateProcedureParameterBean is valid.
#
#; targetProcedureCatalogList = list:{FOO_CATALOG ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o targetProcedureSchemaList: (NotRequired - Default list:{})
# You can specify target schema of generated parameter bean for procedure.
# This property is valid only when generateProcedureParameterBean is valid.
# e.g. list:{PROCEDUREDB}
#
#; targetProcedureSchemaList = list:{FOO_SCHEMA ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o targetProcedureNameList: (NotRequired - Default list:{})
# You can specify target name of generated parameter bean for procedure.
# This property is valid only when isGenerateProcedureParameterBean is valid.
# e.g. list:{prefix:SP_}
# And you can specify procedures through DB link.
# This is treated as additional setting
# so it is independent from specifications for main schema.
# e.g. SP_FOO@NEXT_LINK (when DB link name is 'NEXT_LINK')
#
#; targetProcedureNameList = list:{FOO_PROCEDURE ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o executionMetaProcedureNameList: (NotRequired - Default list:{})
# You can specify target name of generated customize entity for procedure.
# This property is valid only when isGenerateProcedureCustomizeEntity is valid.
# e.g. list:{prefix:SP_}
#
#; executionMetaProcedureNameList = list:{FOO_PROCEDURE ; prefix:FOO_ ; suffix:_FOO ; contain:_FOO_}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o procedureSynonymHandlingType: (NotRequired - Default NONE)
# You can specify the handling type of procedure synonym.
# NONE - No handling. (default)
# INCLUDE - It includes procedure synonyms.
# SWITCH - It switches all normal procedures to procedure synonyms.
#
#; procedureSynonymHandlingType = NONE
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isRequiredSqlTitle: (NotRequired - Default true)
# [true]
# You should always write the title of outsideSql.
# If it doesn't exist, the OutsideSqlTest task fails.
#
# [false]
# Non.
#
#; isRequiredSqlTitle = true
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isRequiredSqlDescription: (NotRequired - Default true)
# [true]
# You should always write the description of outsideSql.
# If it doesn't exist, the OutsideSqlTest task fails.
#
# [false]
# Non.
#
#; isRequiredSqlDescription = true
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o sqlFileEncoding: (NotRequired - Default 'UTF-8')
# The encoding of SQL file for outsideSql.
# Basically you don't need this.
#
#; sqlFileEncoding = UTF-8
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o sqlDirectory: (NotRequired - Default generateOutputDirectory & resourceOutputDirectory)
# The directory of SQL file for outsideSql.
# Basically you don't need this if your directory structure is same as default.
# It's also for DBFlute library project when you use ApplicationOutsideSql.
#
#; sqlDirectory = ../src/main/resources
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o sql2EntityOutputDirectory: (NotRequired - Default generateOutputDirectory)
# The output directory of classes that is generated by Sql2Entity.
# Basically you don't need this if your directory structure is same as default.
# It's also for DBFlute library project when you use ApplicationOutsideSql.
#
#; sql2EntityOutputDirectory = ../src/main/java
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o applicationOutsideSqlMap: (NotRequired - Default map:{})
# You can set additional users.
# Elements of this map are as below:
# o key of map: a relative path to the application project from DBFlute client
# o sqlDirectory: SQL directory as a relative path from the application directory
# (NotRequired - Default Java:'src/main/java' & 'src/main/resources' CSharp:'source')
# o sql2EntityOutputDirectory: source output directory from as a relative path from the application directory
# (NotRequired - Default Java:'src/main/java' CSharp:'source')
#
#; applicationOutsideSqlMap = map:{
# ; ../../app1 = map:{
# ; sqlDirectory = src/main/resources
# ; sql2EntityOutputDirectory = src/main/java
# }
# ; ../../app2 = map:{
# ; sqlDirectory = src/main/resources
# ; sql2EntityOutputDirectory = src/main/java
# }
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o sqlPackage: (NotRequired - Default all packages)
# The package of SQL file for outsideSql.
# This is basically for narrowing SQL-searching target,
# for example, when the project has SQL files for other framework.
# So basically you don't need this.
#
# You can use variable '$$PACKAGE_BASE$$' that means 'packageBase'.
# But you need to make SQL files at 'exbhv' under the set package
# if you use BehaviorQueryPath (MemberBhv_selectSimpleMember.sql).
#
#; sqlPackage = $$PACKAGE_BASE$$
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,19 @@
# /---------------------------------------------------------------------------
# refreshDefinitionMap: (NotRequired - Default map:{})
#
# If you use synchronizer and specify this property,
# You don't need to refresh(F5) your eclipse project.
#
# Specification:
# map:{
# ; projectName = [Eclipse Project1] / [Eclipse Project2] / ...
# ; requestUrl = [synchronizer's URL]
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
; projectName = $$AutoDetect$$
; requestUrl = http://localhost:8386/
}
# ----------------/

View file

@ -0,0 +1,234 @@
# /---------------------------------------------------------------------------
# replaceSchemaDefinitionMap: (NotRequired - Default map:{})
#
# The various settings about replace-schema.
#
# o repsEnvType: (NotRequired - Default inherits or 'ut')
# o isLoggingInsertSql: (NotRequired - Default true)
# o isLoggingReplaceSql: (NotRequired - Default true)
# o isErrorSqlContinue: (NotRequired - Default false)
# o sqlFileEncoding: (NotRequired - Default 'UTF-8')
# o skipSheet: (NotRequired - Default '')
# o isIncrementSequenceToDataMax: (NotRequired - Default false)
# o isSuppressBatchUpdate: (NotRequired - Default false)
# o objectTypeTargetList: (NotRequired - Default databaseInfoMap's)
# o filterVariablesMap: (NotRequired - Default map:{})
# o additionalUserMap: (NotRequired - Default map:{})
# o additionalDropMapList: (NotRequired - Default list:{})
# o playSqlDirectory: (NotRequired - Default 'playsql')
# o applicationPlaySqlDirectory: (NotRequired - Default '')
# o arrangeBeforeRepsMap: (NotRequired - Default map:{})
# o isSuppressTruncateTable: (NotRequired - Default false)
# o isSuppressDropForeignKey: (NotRequired - Default false)
# o isSuppressDropTable: (NotRequired - Default false)
# o isSuppressDropSequence: (NotRequired - Default false)
# o isSuppressDropProcedure: (NotRequired - Default false)
# o isSuppressDropDBLink: (NotRequired - Default false)
# o initializeFirstSqlList: (NotRequired - Default list:{})
#
# *The line that starts with '#' means comment-out.
#
map:{
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o repsEnvType: (NotRequired - Default inherits or 'ut')
# The environment type of ReplaceSchema.
# e.g. if ut, data files in './playsql/data/ut/...' are loaded
# If DBFlute environment type is specified, inherits it as default.
#
#; repsEnvType = ut
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isLoggingInsertSql: (NotRequired - Default true)
# Does it show insert values on log?
#
#; isLoggingInsertSql = true
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isLoggingReplaceSql: (NotRequired - Default true)
# Does it show replace-SQL on log?
#
#; isLoggingReplaceSql = true
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isErrorSqlContinue: (NotRequired - Default false)
# Does it continue the task when error SQL exists?
#
#; isErrorSqlContinue = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o sqlFileEncoding: (NotRequired - Default 'UTF-8')
# The encoding of SQL(DDL) file for Replace Schema.
# Basically you don't need this.
#
#; sqlFileEncoding = UTF-8
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o skipSheet: (NotRequired - Default '')
# You can specify the skip sheet by regular expression
#
#; skipSheet = P.+
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isIncrementSequenceToDataMax: (NotRequired - Default false)
# Does it increment sequence values to max value of table data?
# Referring the property 'sequenceDefinitionMap'.
#
#; isIncrementSequenceToDataMax = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressBatchUpdate: (NotRequired - Default false)
# Does it suppress batch update at loading data?
# When you have a data error, you may get details for the error
# by this property changing. Because it is possible that
# the BatchUpdateException information is very short for debug.
#
#; isSuppressBatchUpdate = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o objectTypeTargetList: (NotRequired - Default databaseInfoMap's)
# This property overrides databaseInfoMap's one for ReplaceSchema.
# e.g. Synonym of Oracle --> list:{TABLE ; VIEW ; SYNONYM}
#
#; objectTypeTargetList = list:{TABLE ; VIEW}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o filterVariablesMap: (NotRequired - Default map:{})
# You can specify the filter variables for DDL.
#
#; filterVariablesMap = map:{abc=AAA}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o additionalUserMap: (NotRequired - Default map:{})
# You can set additional users.
# Elements of this map are as below:
# o key of map: User Definition Name (userDefName)
# o url: (NotRequired - Default same as one of main schema)
# o schema: (NotRequired - Default treated as no schema setting)
# o user: (Required)
# o password: password plainly or path to password file (with default password)
# e.g. foo or df:dfprop/system-password.txt|foo
# (NotRequired - Default '')
# o isSkipIfNotFoundPasswordFileAndDefault: Does it skip the user SQL statement
# when using password file but not found it and also default password?
# (NotRequired - Default false)
#
#; additionalUserMap = map:{
# ; system = map:{
# #; url = ...
# #; schema = ...
# ; user = system
# ; password = df:dfprop/system-password.txt
# }
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o additionalDropMapList: (NotRequired - Default list:{})
# You can drop additional other schemas.
# Elements of this map are as below:
# o url: (NotRequired - Default same as main schema)
# o schema: (Required: if empty schema means valid schema, not required)
# o user: (NotRequired - Default same as main schema)
# o password: (NotRequired - Default same as main schema)
# o propertiesMap: (NotRequired - Default map:{})
# o objectTypeTargetList: (NotRequired - Default list{TABLE;VIEW})
#
#; additionalDropMapList = list:{
# ; map:{
# ; url = jdbc:oracle:thin:...
# ; schema = NEXTEXAMPLEDB
# ; user = NEXTEXAMPLEDB
# ; password = NEXTEXAMPLEDB
# ; propertiesMap = map:{}
# ; objectTypeTargetList = list:{TABLE;VIEW}
# }
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o playSqlDirectory: (NotRequired - Default 'playsql' relative to DBFlute client)
# This property is relative path to (main) PlaySql directory,
# You should not use this property easily.
#
#; playSqlDirectory = ../../foo-project/playsql
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o applicationPlaySqlDirectory: (NotRequired - Default '')
# This property is relative path to Application PlaySql directory,
# which is basically used with ApplicationBehavior.
#
#; applicationPlaySqlDirectory = ../../foo-project/dbflute_apbranch/playsql
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o arrangeBeforeRepsMap: (NotRequired - Default map:{})
# You can arrange resource files before ReplaceSchema.
#
#; arrangeBeforeRepsMap = map:{
# ; copy = map:{
# ; ../erd/*.ddl = ./playsql/replace-schema-10-basic.sql
# }
#}
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressTruncateTable: (NotRequired - Default false)
# You can suppress truncating tables at initializing schema.
#
#; isSuppressTruncateTable = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressDropForeignKey: (NotRequired - Default false)
# You can suppress dropping foreign keys at initializing schema.
#
#; isSuppressDropForeignKey = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressDropTable: (NotRequired - Default false)
# You can suppress dropping tables at initializing schema.
#
#; isSuppressDropTable = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressDropSequence: (NotRequired - Default false)
# You can suppress dropping sequences at initializing schema.
#
#; isSuppressDropSequence = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressDropProcedure: (NotRequired - Default false)
# You can suppress dropping procedures at initializing schema.
#
#; isSuppressDropProcedure = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o isSuppressDropDBLink: (NotRequired - Default false)
# You can suppress dropping DB links at initializing schema.
#
#; isSuppressDropDBLink = false
# - - - - - - - - - -/
# /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# o initializeFirstSqlList: (NotRequired - Default list:{})
# You can execute the SQL statements before initializing schema.
#
#; initializeFirstSqlList = list:{}
# - - - - - - - - - -/
}
# ----------------/

View file

@ -0,0 +1,25 @@
# /---------------------------------------------------------------------------
# sequenceDefinitionMap: (NotRequired - Default map:{})
#
# The relation mappings between sequence and table.
# If you don't specify the mappings, you cannot insert
# a record of the table by sequence.
# The table names are treated as case insensitive.
#
# Example:
# map:{
# ; PURCHASE = SEQ_PURCHASE
# ; MEMBER = SEQ_MEMBER
# ; MEMBER_LOGIN = SEQ_MEMBER_LOGIN
# ; PRODUCT = SEQ_PRODUCT
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
#; PURCHASE = SEQ_PURCHASE
#; MEMBER = SEQ_MEMBER
#; MEMBER_LOGIN = SEQ_MEMBER_LOGIN
#; PRODUCT = SEQ_PRODUCT
}
# ----------------/

View file

@ -0,0 +1,57 @@
# /---------------------------------------------------------------------------
# typeMappingMap: (NotRequired - Default map:{})
#
# If you want to change mappings from default mappings,
# you can specify your original mappings.
# But it is possible that unanticipated problems occurs, so be careful!
#
# About '$$AutoMapping$$':
# If the database is Oracle, they often use this.
# For example, if you use this for NUMERIC.
# o Numeric( 1 - 9 , 0) is mapping to INTEGER
# o Numeric(10 - 18 , 0) is mapping to BIGINT
# o Numeric(19 - 38 , 0) is mapping to NUMERIC
# o Numeric( 1 - 38 , 2) is mapping to NUMERIC
#
# Example:
# map:{
# ; INTEGER = java.lang.Integer
# ; BIGINT = java.lang.Long
# }
#
# *The line that starts with '#' means comment-out.
#
map:{
# AutoMapping for Numeric and Decimal
; NUMERIC = $$AutoMapping$$ ; DECIMAL = $$AutoMapping$$
}
# ----------------/
#
# Default mapping as follows:
# --------------------------------------------------------
# | JDBC Type | Java Native | CSharp Native |
# | ------------------------------------------------------
# | CHAR | java.lang.String | String |
# | VARCHAR | java.lang.String | String |
# | LONGVARCHAR | java.lang.String | String |
# | NUMERIC | java.math.BigDecimal | decimal? |
# | DECIMAL | java.math.BigDecimal | decimal? |
# | TINYINT | java.lang.Integer | int? |
# | SMALLINT | java.lang.Integer | int? |
# | INTEGER | java.lang.Integer | int? |
# | BIGINT | java.lang.Long | long? |
# | REAL | java.math.BigDecimal | decimal? |
# | FLOAT | java.math.BigDecimal | decimal? |
# | DOUBLE | java.math.BigDecimal | decimal? |
# | DATE | java.util.Date | DateTime? |
# | TIME | java.sql.Time | DateTime? |
# | TIMESTAMP | java.sql.Timestamp | DateTime? |
# | BIT | java.lang.Boolean | bool? |
# | BOOLEAN | java.lang.Boolean | bool? |
# | BINARY | byte[] | byte[] |
# | VARBINARY | byte[] | byte[] |
# | LONGVARBINARY | byte[] | byte[] |
# | BLOB | byte[] | byte[] |
# | ARRAY | *Unsupported | *Unsupported |
# | UUID | java.util.UUID | *Unsupported |
# --------------------------------------------------------

View file

@ -0,0 +1,5 @@
Directory for library extension
If you use a database that DBFlute does not have its JDBC driver,
put your own JDBC driver for the database here.
(e.g. Oracle, DB2, SQLServer)

Binary file not shown.

View file

@ -0,0 +1,154 @@
$manager.info("requestList: ${requestList.size()}")
#foreach ($request in $requestList)
#set ($tableMap = $request.tableMap)
$request.enableOutputDirectory()
$manager.makeDirectory($request.generateDirPath)
#if ($request.isResourceTypeJsonSchema())
#if ($request.requestName == "JsonBeanGen")
##
## <<< Json Schema Gen >>>
##
#foreach ($table in $request.tableList)
#set ($path = "${request.generateDirPath}/bean/bs/Bs${table.camelizedName}.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./json/BsJsonBean.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/bean/ex/${table.camelizedName}.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
#if (!$files.file(${generator.outputPath},$path).exists())
$generator.parse("./json/ExJsonBean.vm", $path, "", "")
#end
#end
#end
#elseif ($request.isResourceTypeSolr())
#if ($request.requestName == "SolrBeanGen")
##
## <<< Solr (Xml) Gen >>>
##
#set ($table = $request.table)
#set ($path = "${request.generateDirPath}/bean/bs/${tableMap.baseBeanClassName}.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./solr/BsSolrBean.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/bean/ex/${tableMap.extendedBeanClassName}.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
#if (!$files.file(${generator.outputPath},$path).exists())
$generator.parse("./solr/ExSolrBean.vm", $path, "", "")
#end
#end
#elseif ($request.isResourceTypeElasticsearch())
#if ($request.requestName == "ElasticsearchBeanGen")
##
## <<< Elasticsearch Schema Gen >>>
##
#foreach ($table in $request.tableList)
#set ($path = "${request.generateDirPath}/bsentity/dbmeta/${table.camelizedName}Dbm.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/DBMeta.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/bsentity/Bs${table.camelizedName}.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/BsEntity.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/exentity/${table.camelizedName}.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
#if (!$files.file(${generator.outputPath},$path).exists())
$generator.parse("./elasticsearch/ExEntity.vm", $path, "", "")
#end
#set ($path = "${request.generateDirPath}/cbean/bs/Bs${table.camelizedName}CB.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/BsConditionBean.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/cbean/${table.camelizedName}CB.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
#if (!$files.file(${generator.outputPath},$path).exists())
$generator.parse("./elasticsearch/ExConditionBean.vm", $path, "", "")
#end
#set ($path = "${request.generateDirPath}/cbean/cq/bs/Bs${table.camelizedName}CQ.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/BsConditionQuery.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/cbean/cq/${table.camelizedName}CQ.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
#if (!$files.file(${generator.outputPath},$path).exists())
$generator.parse("./elasticsearch/ExConditionQuery.vm", $path, "", "")
#end
#set ($path = "${request.generateDirPath}/bsbhv/Bs${table.camelizedName}Bhv.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/BsBehavior.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/exbhv/${table.camelizedName}Bhv.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
#if (!$files.file(${generator.outputPath},$path).exists())
$generator.parse("./elasticsearch/ExBehavior.vm", $path, "", "")
#end
#end
#set ($path = "${request.generateDirPath}/cbean/bs/AbstractConditionBean.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/AbstractConditionBean.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/cbean/cq/bs/AbstractConditionQuery.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/AbstractConditionQuery.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/bsentity/AbstractEntity.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/AbstractEntity.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/bsbhv/AbstractBehavior.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/AbstractBehavior.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/cbean/result/EsPagingResultBean.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/EsPagingResultBean.vm", $path, "", "")
#set ($path = "${request.generateDirPath}/cbean/sqlclause/SqlClauseEs.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse("./elasticsearch/SqlClauseEs.vm", $path, "", "")
#end
#else
##
## <<< Normal Gen >>>
##
#if ($request.isOnlyOneTable())
#set ($table = $request.table)
$request.info("parse('${request.generateFilePath}')")
$generator.parse($request.templatePath, $request.generateFilePath, "", "")
#else
#foreach ($table in $request.tableList)
#set ($path = "${request.generateDirPath}/${table.camelizedName}.java")
$manager.makeDirectory($path)
$request.info("parse('${path}')")
$generator.parse($request.templatePath, $path, "", "")
#end
#end
#end
#end

View file

@ -0,0 +1,138 @@
package ${request.package}.bsbhv;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import ${request.package}.bsentity.AbstractEntity;
import ${request.package}.bsentity.AbstractEntity.DocMeta;
import ${request.package}.bsentity.AbstractEntity.RequestOptionCall;
import ${request.package}.cbean.bs.AbstractConditionBean;
import ${request.package}.cbean.result.EsPagingResultBean;
import org.dbflute.Entity;
import org.dbflute.bhv.AbstractBehaviorWritable;
import org.dbflute.bhv.writable.DeleteOption;
import org.dbflute.bhv.writable.InsertOption;
import org.dbflute.bhv.writable.UpdateOption;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.elasticsearch.action.count.CountRequestBuilder;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.search.SearchHits;
public abstract class AbstractBehavior<ENTITY extends Entity, CB extends ConditionBean> extends AbstractBehaviorWritable<ENTITY, CB> {
@Resource
protected Client client;
protected abstract String asIndexEsName();
protected abstract <RESULT extends ENTITY> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType);
@Override
protected int delegateSelectCountUniquely(ConditionBean cb) {
// TODO check response and cast problem
CountRequestBuilder builder = client.prepareCount(asIndexEsName()).setTypes(asTableDbName());
return (int) ((AbstractConditionBean) cb).build(builder).execute().actionGet().getCount();
}
protected <RESULT extends ENTITY> List<RESULT> delegateSelectList(ConditionBean cb, Class<? extends RESULT> entityType) {
// TODO check response
SearchRequestBuilder builder = client.prepareSearch(asIndexEsName()).setTypes(asTableDbName());
if (cb.isFetchScopeEffective()) {
builder.setFrom(cb.getFetchStartIndex());
builder.setSize(cb.getFetchSize());
}
((AbstractConditionBean) cb).request().build(builder);
SearchResponse response = ((AbstractConditionBean) cb).build(builder).execute().actionGet();
EsPagingResultBean<RESULT> list = new EsPagingResultBean<>();
SearchHits searchHits = response.getHits();
searchHits.forEach(hit -> {
Map<String, Object> source = hit.getSource();
RESULT entity = createEntity(source, entityType);
DocMeta docMeta = ((AbstractEntity) entity).asDocMeta();
docMeta.id(hit.getId());
docMeta.version(hit.getVersion());
list.add(entity);
});
list.setAllRecordCount((int) searchHits.totalHits());
list.setPageSize(cb.getFetchSize());
list.setCurrentPageNumber(cb.getFetchPageNumber());
list.setTook(response.getTookInMillis());
list.setTotalShards(response.getTotalShards());
list.setSuccessfulShards(response.getSuccessfulShards());
list.setFailedShards(response.getFailedShards());
// TODO others
return list;
}
@Override
protected Number doReadNextVal() {
String msg = "This table is NOT related to sequence: " + asTableDbName();
throw new UnsupportedOperationException(msg);
}
@Override
protected <RESULT extends Entity> ListResultBean<RESULT> createListResultBean(ConditionBean cb, List<RESULT> selectedList) {
if (selectedList instanceof EsPagingResultBean) {
return (ListResultBean<RESULT>) selectedList;
}
throw new IllegalBehaviorStateException("selectedList is not EsPagingResultBean.");
}
@Override
protected int delegateInsert(Entity entity, InsertOption<? extends ConditionBean> option) {
AbstractEntity esEntity = (AbstractEntity) entity;
IndexRequestBuilder builder = client.prepareIndex(asIndexEsName(), asTableDbName()).setSource(esEntity.toSource());
RequestOptionCall<IndexRequestBuilder> indexOption = esEntity.asDocMeta().indexOption();
if (indexOption != null) {
indexOption.callback(builder);
}
IndexResponse response = builder.execute().actionGet();
esEntity.asDocMeta().id(response.getId());
return response.isCreated() ? 1 : 0;
}
@Override
protected int delegateUpdate(Entity entity, UpdateOption<? extends ConditionBean> option) {
AbstractEntity esEntity = (AbstractEntity) entity;
IndexRequestBuilder builder =
client.prepareIndex(asIndexEsName(), asTableDbName(), esEntity.asDocMeta().id()).setSource(esEntity.toSource());
RequestOptionCall<IndexRequestBuilder> indexOption = esEntity.asDocMeta().indexOption();
if (indexOption != null) {
indexOption.callback(builder);
}
Long version = esEntity.asDocMeta().version();
if (version != null && version.longValue() != -1) {
builder.setVersion(version);
}
IndexResponse response = builder.execute().actionGet();
return 1;
}
@Override
protected int delegateDelete(Entity entity, DeleteOption<? extends ConditionBean> option) {
AbstractEntity esEntity = (AbstractEntity) entity;
DeleteRequestBuilder builder = client.prepareDelete(asIndexEsName(), asTableDbName(), esEntity.asDocMeta().id());
RequestOptionCall<DeleteRequestBuilder> deleteOption = esEntity.asDocMeta().deleteOption();
if (deleteOption != null) {
deleteOption.callback(builder);
}
DeleteResponse response = builder.execute().actionGet();
return response.isFound() ? 1 : 0;
}
}

View file

@ -0,0 +1,650 @@
package ${request.package}.cbean.bs;
import ${request.package}.cbean.sqlclause.SqlClauseEs;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.chelper.HpCBPurpose;
import org.dbflute.cbean.chelper.HpColumnSpHandler;
import org.dbflute.cbean.coption.CursorSelectOption;
import org.dbflute.cbean.coption.ScalarSelectOption;
import org.dbflute.cbean.coption.StatementConfigCall;
import org.dbflute.cbean.dream.SpecifiedColumn;
import org.dbflute.cbean.exception.ConditionBeanExceptionThrower;
import org.dbflute.cbean.ordering.OrderByBean;
import org.dbflute.cbean.paging.PagingBean;
import org.dbflute.cbean.paging.PagingInvoker;
import org.dbflute.cbean.scoping.AndQuery;
import org.dbflute.cbean.scoping.ModeQuery;
import org.dbflute.cbean.scoping.OrQuery;
import org.dbflute.cbean.scoping.UnionQuery;
import org.dbflute.cbean.sqlclause.SqlClause;
import org.dbflute.cbean.sqlclause.orderby.OrderByClause;
import org.dbflute.dbmeta.DBMeta;
import org.dbflute.dbmeta.accessory.DerivedTypeHandler;
import org.dbflute.jdbc.StatementConfig;
import org.dbflute.system.DBFluteSystem;
import org.dbflute.twowaysql.style.BoundDateDisplayStyle;
import org.elasticsearch.action.count.CountRequestBuilder;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.common.unit.TimeValue;
/**
* @author FreeGen
*/
public abstract class AbstractConditionBean implements ConditionBean {
protected int _safetyMaxResultSize;
protected final SqlClause _sqlClause = new SqlClauseEs(asTableDbName());
private SearchRequestParams _searchRequestParams = new SearchRequestParams();
public abstract CountRequestBuilder build(CountRequestBuilder builder);
public abstract SearchRequestBuilder build(SearchRequestBuilder builder);
@Override
public boolean isPaging() {
return false;
}
@Override
public boolean canPagingCountLater() {
return false;
}
@Override
public boolean canPagingReSelect() {
return true;
}
@Override
public void paging(int pageSize, int pageNumber) {
if (pageSize <= 0) {
throwPagingPageSizeNotPlusException(pageSize, pageNumber);
}
fetchFirst(pageSize);
xfetchPage(pageNumber);
}
protected void throwPagingPageSizeNotPlusException(int pageSize, int pageNumber) {
createCBExThrower().throwPagingPageSizeNotPlusException(this, pageSize, pageNumber);
}
protected ConditionBeanExceptionThrower createCBExThrower() {
return new ConditionBeanExceptionThrower();
}
protected void assertObjectNotNull(String variableName, Object value) {
if (variableName == null) {
String msg = "The value should not be null: variableName=null value=" + value;
throw new IllegalArgumentException(msg);
}
if (value == null) {
String msg = "The value should not be null: variableName=" + variableName;
throw new IllegalArgumentException(msg);
}
}
@Override
public void xsetPaging(boolean paging) {
// Do nothing because this is unsupported on ConditionBean.
// And it is possible that this method is called by PagingInvoker.
}
@Override
public void enablePagingCountLater() {
// nothing
}
@Override
public void disablePagingCountLater() {
// nothing
}
@Override
public void enablePagingReSelect() {
// nothing
}
@Override
public void disablePagingReSelect() {
// nothing
}
@Override
public PagingBean fetchFirst(int fetchSize) {
getSqlClause().fetchFirst(fetchSize);
return this;
}
@Override
public PagingBean xfetchScope(int fetchStartIndex, int fetchSize) {
getSqlClause().fetchScope(fetchStartIndex, fetchSize);
return this;
}
@Override
public PagingBean xfetchPage(int fetchPageNumber) {
getSqlClause().fetchPage(fetchPageNumber);
return this;
}
protected String ln() {
return DBFluteSystem.ln();
}
@Override
public <ENTITY> PagingInvoker<ENTITY> createPagingInvoker(String tableDbName) {
// TODO Auto-generated method stub
return null;
}
@Override
public int getFetchStartIndex() {
return getSqlClause().getFetchStartIndex();
}
@Override
public int getFetchSize() {
return getSqlClause().getFetchSize();
}
@Override
public int getFetchPageNumber() {
return getSqlClause().getFetchPageNumber();
}
@Override
public int getPageStartIndex() {
return getSqlClause().getPageStartIndex();
}
@Override
public int getPageEndIndex() {
return getSqlClause().getPageEndIndex();
}
@Override
public boolean isFetchScopeEffective() {
return getSqlClause().isFetchScopeEffective();
}
@Override
public int getFetchNarrowingSkipStartIndex() {
return getPageStartIndex();
}
@Override
public int getFetchNarrowingLoopCount() {
return getFetchSize();
}
@Override
public boolean isFetchNarrowingSkipStartIndexEffective() {
return false;
}
@Override
public boolean isFetchNarrowingLoopCountEffective() {
return false;
}
@Override
public boolean isFetchNarrowingEffective() {
return getSqlClause().isFetchNarrowingEffective();
}
@Override
public void xdisableFetchNarrowing() {
// no need to disable in ConditionBean, basically for OutsideSql
String msg = "This method is unsupported on ConditionBean!";
throw new UnsupportedOperationException(msg);
}
@Override
public void xenableIgnoredFetchNarrowing() {
// do nothing
}
@Override
public void checkSafetyResult(int safetyMaxResultSize) {
_safetyMaxResultSize = safetyMaxResultSize;
}
@Override
public int getSafetyMaxResultSize() {
return _safetyMaxResultSize;
}
@Override
public String getOrderByClause() {
return null;
}
@Override
public OrderByClause getOrderByComponent() {
return null;
}
@Override
public OrderByBean clearOrderBy() {
return null;
}
@Override
public void overTheWaves(SpecifiedColumn dreamCruiseTicket) {
// do nothing
}
@Override
public void mysticRhythms(Object mysticBinding) {
// do nothing
}
@Override
public DBMeta asDBMeta() {
return null;
}
@Override
public SqlClause getSqlClause() {
return _sqlClause;
}
@Override
public ConditionBean addOrderBy_PK_Asc() {
return null;
}
@Override
public ConditionBean addOrderBy_PK_Desc() {
return null;
}
@Override
public HpColumnSpHandler localSp() {
return null;
}
@Override
public void enableInnerJoinAutoDetect() {
// do nothing
}
@Override
public void disableInnerJoinAutoDetect() {
// do nothing
}
@Override
public SpecifiedColumn inviteDerivedToDreamCruise(String derivedAlias) {
return null;
}
@Override
public ConditionBean xcreateDreamCruiseCB() {
return null;
}
@Override
public void xmarkAsDeparturePortForDreamCruise() {
// do nothing
}
@Override
public boolean xisDreamCruiseDeparturePort() {
return false;
}
@Override
public boolean xisDreamCruiseShip() {
return false;
}
@Override
public ConditionBean xgetDreamCruiseDeparturePort() {
return null;
}
@Override
public boolean xhasDreamCruiseTicket() {
return false;
}
@Override
public SpecifiedColumn xshowDreamCruiseTicket() {
return null;
}
@Override
public void xkeepDreamCruiseJourneyLogBook(String relationPath) {
// do nothing
}
@Override
public void xsetupSelectDreamCruiseJourneyLogBook() {
// do nothing
}
@Override
public void xsetupSelectDreamCruiseJourneyLogBookIfUnionExists() {
// do nothing
}
@Override
public Object xgetMysticBinding() {
return null;
}
@Override
public void ignoreNullOrEmptyQuery() {
// TODO
}
@Override
public void checkNullOrEmptyQuery() {
// TODO
}
@Override
public void enableEmptyStringQuery(ModeQuery noArgInLambda) {
// do nothing
}
@Override
public void disableEmptyStringQuery() {
// TODO
}
@Override
public void enableOverridingQuery(ModeQuery noArgInLambda) {
// do nothing
}
@Override
public void disableOverridingQuery() {
// do nothing
}
@Override
public void enablePagingCountLeastJoin() {
// do nothing
}
@Override
public void disablePagingCountLeastJoin() {
// do nothing
}
@Override
public boolean canPagingSelectAndQuerySplit() {
return false;
}
@Override
public ConditionBean lockForUpdate() {
return null;
}
@Override
public ConditionBean xsetupSelectCountIgnoreFetchScope(boolean uniqueCount) {
return null;
}
@Override
public ConditionBean xafterCareSelectCountIgnoreFetchScope() {
return null;
}
@Override
public boolean isSelectCountIgnoreFetchScope() {
return false;
}
@Override
public CursorSelectOption getCursorSelectOption() {
return null;
}
@Override
public void xacceptScalarSelectOption(ScalarSelectOption option) {
// do nothing
}
@Override
public void configure(StatementConfigCall<StatementConfig> confLambda) {
// do nothing
}
@Override
public StatementConfig getStatementConfig() {
return null;
}
@Override
public boolean canRelationMappingCache() {
return false;
}
@Override
public void enableNonSpecifiedColumnAccess() {
// do nothing
}
@Override
public void disableNonSpecifiedColumnAccess() {
// do nothing
}
@Override
public boolean isNonSpecifiedColumnAccessAllowed() {
return false;
}
@Override
public void enableColumnNullObject() {
// TODO
}
@Override
public void disableColumnNullObject() {
// TODO
}
@Override
public void enableQueryUpdateCountPreCheck() {
// do nothing
}
@Override
public void disableQueryUpdateCountPreCheck() {
// do nothing
}
@Override
public boolean isQueryUpdateCountPreCheck() {
return false;
}
@Override
public String toDisplaySql() {
// TODO
return null;
}
@Override
public void styleLogDateDisplay(BoundDateDisplayStyle logDateDisplayStyle) {
// do nothing
}
@Override
public BoundDateDisplayStyle getLogDateDisplayStyle() {
return null;
}
@Override
public boolean hasWhereClauseOnBaseQuery() {
return false;
}
@Override
public void clearWhereClauseOnBaseQuery() {
// do nothing
}
@Override
public boolean hasSelectAllPossible() {
return false;
}
@Override
public boolean hasOrderByClause() {
return false;
}
@Override
public boolean hasUnionQueryOrUnionAllQuery() {
return false;
}
@Override
public void invokeSetupSelect(String foreignPropertyNamePath) {
// do nothing
}
@Override
public SpecifiedColumn invokeSpecifyColumn(String columnPropertyPath) {
return null;
}
@Override
public void invokeOrScopeQuery(OrQuery<ConditionBean> orQuery) {
// do nothing
}
@Override
public void invokeOrScopeQueryAndPart(AndQuery<ConditionBean> andQuery) {
// do nothing
}
@Override
public void xregisterUnionQuerySynchronizer(UnionQuery<ConditionBean> unionQuerySynchronizer) {
// do nothing
}
@Override
public DerivedTypeHandler xgetDerivedTypeHandler() {
return null;
}
@Override
public HpCBPurpose getPurpose() {
return null;
}
@Override
public void xsetupForScalarSelect() {
// do nothing
}
@Override
public void xsetupForQueryInsert() {
// do nothing
}
@Override
public void xsetupForSpecifiedUpdate() {
// do nothing
}
@Override
public void xsetupForVaryingUpdate() {
// do nothing
}
@Override
public void enableThatsBadTiming() {
// do nothing
}
@Override
public void disableThatsBadTiming() {
// do nothing
}
public SearchRequestParams request() {
return _searchRequestParams;
}
public static class SearchRequestParams {
private Boolean explain;
private Float minScore;
private String preference;
private String routing;
private String searchType;
private long timeoutInMillis = -1;
private Boolean version;
public void build(SearchRequestBuilder builder) {
if (explain != null) {
builder.setExplain(explain);
}
if (minScore != null) {
builder.setMinScore(minScore);
}
if (preference != null) {
builder.setPreference(preference);
}
if (routing != null) {
builder.setRouting(routing);
}
if (searchType != null) {
builder.setSearchType(searchType);
}
if (timeoutInMillis == -1) {
builder.setTimeout(new TimeValue(timeoutInMillis));
}
if (version != null) {
builder.setVersion(version);
}
}
public void setExplain(boolean explain) {
this.explain = explain;
}
public void setMinScore(float minScore) {
this.minScore = minScore;
}
public void setPreference(String preference) {
this.preference = preference;
}
public void setRouting(String routing) {
this.routing = routing;
}
public void setSearchType(String searchType) {
this.searchType = searchType;
}
public void setTimeoutInMillis(long timeoutInMillis) {
this.timeoutInMillis = timeoutInMillis;
}
public void setVersion(boolean version) {
this.version = version;
}
}
}

View file

@ -0,0 +1,362 @@
package ${request.package}.cbean.cq.bs;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.ConditionQuery;
import org.dbflute.cbean.ckey.ConditionKey;
import org.dbflute.cbean.coption.ConditionOption;
import org.dbflute.cbean.coption.ParameterOption;
import org.dbflute.cbean.cvalue.ConditionValue;
import org.dbflute.cbean.sqlclause.SqlClause;
import org.dbflute.dbmeta.info.ColumnInfo;
import org.dbflute.dbmeta.name.ColumnRealName;
import org.dbflute.dbmeta.name.ColumnSqlName;
import org.dbflute.util.Srl;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.FilterBuilder;
import org.elasticsearch.index.query.FilteredQueryBuilder;
import org.elasticsearch.index.query.FuzzyQueryBuilder;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.PrefixQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.QueryStringQueryBuilder;
import org.elasticsearch.index.query.RangeQueryBuilder;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.index.query.TermsQueryBuilder;
import org.elasticsearch.search.sort.FieldSortBuilder;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
/**
* @author FreeGen
*/
public abstract class AbstractConditionQuery implements ConditionQuery {
protected static final String CQ_PROPERTY = "conditionQuery";
protected List<QueryBuilder> queryBuilderList;
protected List<FieldSortBuilder> fieldSortBuilderList;
private DocMetaCQ docMetaCQ;
public DocMetaCQ docMeta() {
if (docMetaCQ == null) {
docMetaCQ = new DocMetaCQ();
}
return docMetaCQ;
}
public List<FieldSortBuilder> getFieldSortBuilderList() {
return fieldSortBuilderList == null ? Collections.emptyList() : fieldSortBuilderList;
}
public QueryBuilder getQuery() {
if (queryBuilderList == null) {
return null;
} else if (queryBuilderList.size() == 1) {
return queryBuilderList.get(0);
}
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
queryBuilderList.forEach(query -> {
boolQuery.must(query);
});
return boolQuery;
}
public void addQuery(QueryBuilder queryBuilder) {
queryBuilderList.add(queryBuilder);
}
public void queryString(String queryString) {
queryString(queryString, null);
}
public void queryString(String queryString, ConditionOptionCall<QueryStringQueryBuilder> opLambda) {
QueryStringQueryBuilder queryStringQuery = QueryBuilders.queryStringQuery(queryString);
regQ(queryStringQuery);
if (opLambda != null) {
opLambda.callback(queryStringQuery);
}
}
protected FilteredQueryBuilder reqFilteredQ(QueryBuilder queryBuilder, FilterBuilder filterBuilder) {
return QueryBuilders.filteredQuery(queryBuilder, filterBuilder);
}
protected BoolQueryBuilder reqBoolCQ(List<QueryBuilder> mustList, List<QueryBuilder> shouldList, List<QueryBuilder> mustNotList) {
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
mustList.forEach(query -> {
boolQuery.must(query);
});
shouldList.forEach(query -> {
boolQuery.should(query);
});
mustNotList.forEach(query -> {
boolQuery.mustNot(query);
});
return boolQuery;
}
protected TermQueryBuilder reqTermQ(String name, Object value) {
TermQueryBuilder termQuery = QueryBuilders.termQuery(name, value);
regQ(termQuery);
return termQuery;
}
protected TermsQueryBuilder reqTermsQ(String name, Collection<?> value) {
TermsQueryBuilder termsQuery = QueryBuilders.termsQuery(name, value);
regQ(termsQuery);
return termsQuery;
}
protected MatchQueryBuilder reqMatchQ(String name, Object value) {
MatchQueryBuilder matchQuery = QueryBuilders.matchQuery(name, value);
regQ(matchQuery);
return matchQuery;
}
protected MatchQueryBuilder reqMatchPhraseQ(String name, Object value) {
MatchQueryBuilder matchQuery = QueryBuilders.matchPhraseQuery(name, value);
regQ(matchQuery);
return matchQuery;
}
protected MatchQueryBuilder reqMatchPhrasePrefixQ(String name, Object value) {
MatchQueryBuilder matchQuery = QueryBuilders.matchPhrasePrefixQuery(name, value);
regQ(matchQuery);
return matchQuery;
}
protected FuzzyQueryBuilder reqFuzzyQ(String name, Object value) {
FuzzyQueryBuilder fuzzyQuery = QueryBuilders.fuzzyQuery(name, value);
regQ(fuzzyQuery);
return fuzzyQuery;
}
protected PrefixQueryBuilder reqPrefixQ(String name, String prefix) {
PrefixQueryBuilder prefixQuery = QueryBuilders.prefixQuery(name, prefix);
regQ(prefixQuery);
return prefixQuery;
}
protected RangeQueryBuilder reqRangeQ(String name, ConditionKey ck, Object value) {
for (QueryBuilder builder : queryBuilderList) {
if (builder instanceof RangeQueryBuilder) {
RangeQueryBuilder rangeQueryBuilder = (RangeQueryBuilder) builder;
if (rangeQueryBuilder.toString().replaceAll("\\s", "").startsWith("{\"range\":{\"" + name + "\"")) {
addRangeC(rangeQueryBuilder, ck, value);
return rangeQueryBuilder;
}
}
}
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(name);
addRangeC(rangeQueryBuilder, ck, value);
regQ(rangeQueryBuilder);
return rangeQueryBuilder;
}
protected void addRangeC(RangeQueryBuilder builder, ConditionKey ck, Object value) {
if (ck.equals(ConditionKey.CK_GREATER_THAN)) {
builder.gt(value);
} else if (ck.equals(ConditionKey.CK_GREATER_EQUAL)) {
builder.gte(value);
} else if (ck.equals(ConditionKey.CK_LESS_THAN)) {
builder.lt(value);
} else if (ck.equals(ConditionKey.CK_LESS_EQUAL)) {
builder.lte(value);
}
}
protected void regQ(QueryBuilder builder) {
if (queryBuilderList == null) {
queryBuilderList = new ArrayList<>();
}
queryBuilderList.add(builder);
}
protected void regOBA(String field) {
registerOrderBy(field, true);
}
protected void regOBD(String field) {
registerOrderBy(field, false);
}
protected void registerOrderBy(String field, boolean ascOrDesc) {
if (fieldSortBuilderList == null) {
fieldSortBuilderList = new ArrayList<>();
}
fieldSortBuilderList.add(SortBuilders.fieldSort(field).order(ascOrDesc ? SortOrder.ASC : SortOrder.DESC));
}
@Override
public ColumnRealName toColumnRealName(String columnDbName) {
return ColumnRealName.create(xgetAliasName(), toColumnSqlName(columnDbName));
}
@Override
public ColumnRealName toColumnRealName(ColumnInfo columnInfo) {
return ColumnRealName.create(xgetAliasName(), columnInfo.getColumnSqlName());
}
@Override
public ColumnSqlName toColumnSqlName(String columnDbName) {
return new ColumnSqlName(columnDbName);
}
@Override
public ConditionBean xgetBaseCB() {
return null;
}
@Override
public ConditionQuery xgetBaseQuery() {
return null;
}
@Override
public ConditionQuery xgetReferrerQuery() {
return null;
}
@Override
public SqlClause xgetSqlClause() {
return null;
}
@Override
public int xgetNestLevel() {
return 0;
}
@Override
public int xgetNextNestLevel() {
return 0;
}
@Override
public boolean isBaseQuery() {
return false;
}
@Override
public String xgetForeignPropertyName() {
// TODO
return null;
}
@Override
public String xgetRelationPath() {
// TODO
return null;
}
@Override
public String xgetLocationBase() {
final StringBuilder sb = new StringBuilder();
ConditionQuery query = this;
while (true) {
if (query.isBaseQuery()) {
sb.insert(0, CQ_PROPERTY + ".");
break;
} else {
final String foreignPropertyName = query.xgetForeignPropertyName();
if (foreignPropertyName == null) {
String msg = "The foreignPropertyName of the query should not be null:";
msg = msg + " query=" + query;
throw new IllegalStateException(msg);
}
sb.insert(0, CQ_PROPERTY + initCap(foreignPropertyName) + ".");
}
query = query.xgetReferrerQuery();
}
return sb.toString();
}
protected String initCap(String str) {
return Srl.initCap(str);
}
@Override
public ConditionValue invokeValue(String columnFlexibleName) {
return null;
}
@Override
public void invokeQuery(String columnFlexibleName, String conditionKeyName, Object conditionValue) {
// nothing
}
@Override
public void invokeQuery(String columnFlexibleName, String conditionKeyName, Object conditionValue, ConditionOption conditionOption) {
// nothing
}
@Override
public void invokeQueryEqual(String columnFlexibleName, Object conditionValue) {
// nothing
}
@Override
public void invokeQueryNotEqual(String columnFlexibleName, Object conditionValue) {
// nothing
}
@Override
public void invokeOrderBy(String columnFlexibleName, boolean isAsc) {
// nothing
}
@Override
public ConditionQuery invokeForeignCQ(String foreignPropertyName) {
// TODO
return null;
}
@Override
public boolean invokeHasForeignCQ(String foreignPropertyName) {
// TODO
return false;
}
@Override
public void xregisterParameterOption(ParameterOption option) {
// nothing
}
public class DocMetaCQ {
public void setId_Equal(String id) {
regQ(QueryBuilders.idsQuery(asTableDbName()).addIds(id));
}
}
@FunctionalInterface
public interface ConditionOptionCall<OP extends QueryBuilder> {
/**
* @param op The option of condition to be set up. (NotNull)
*/
void callback(OP op);
}
@FunctionalInterface
public interface BoolCall<CQ extends AbstractConditionQuery> {
void callback(CQ must, CQ should, CQ mustNot);
}
@FunctionalInterface
public interface FilteredCall<CQ extends AbstractConditionQuery> {
void callback(CQ query);
}
}

View file

@ -0,0 +1,221 @@
package ${request.package}.bsentity;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import org.dbflute.Entity;
import org.dbflute.FunCustodial;
import org.dbflute.dbmeta.accessory.EntityModifiedProperties;
import org.dbflute.dbmeta.accessory.EntityUniqueDrivenProperties;
import org.dbflute.util.DfCollectionUtil;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class AbstractEntity implements Entity, Serializable, Cloneable {
private static final long serialVersionUID = 1L;
protected DocMeta docMeta;
protected final EntityUniqueDrivenProperties __uniqueDrivenProperties = newUniqueDrivenProperties();
protected final EntityModifiedProperties __modifiedProperties = newModifiedProperties();
protected EntityModifiedProperties __specifiedProperties;
public DocMeta asDocMeta() {
if (docMeta == null) {
docMeta = new DocMeta();
}
return docMeta;
}
public Set<String> mymodifiedProperties() {
return __modifiedProperties.getPropertyNames();
}
public void mymodifyProperty(String propertyName) {
registerModifiedProperty(propertyName);
}
public void mymodifyPropertyCancel(String propertyName) {
__modifiedProperties.remove(propertyName);
}
public void clearModifiedInfo() {
__modifiedProperties.clear();
}
public boolean hasModification() {
return !__modifiedProperties.isEmpty();
}
protected EntityModifiedProperties newModifiedProperties() {
return new EntityModifiedProperties();
}
protected void registerModifiedProperty(String propertyName) {
__modifiedProperties.addPropertyName(propertyName);
registerSpecifiedProperty(propertyName); // synchronize if exists, basically for user's manual call
}
public void modifiedToSpecified() {
if (__modifiedProperties.isEmpty()) {
return; // basically no way when called in Framework (because called when SpecifyColumn exists)
}
__specifiedProperties = newModifiedProperties();
__specifiedProperties.accept(__modifiedProperties);
}
public Set<String> myspecifiedProperties() {
if (__specifiedProperties != null) {
return __specifiedProperties.getPropertyNames();
}
return DfCollectionUtil.emptySet();
}
public void myspecifyProperty(String propertyName) {
registerSpecifiedProperty(propertyName);
}
public void myspecifyPropertyCancel(String propertyName) {
if (__specifiedProperties != null) {
__specifiedProperties.remove(propertyName);
}
}
public void clearSpecifiedInfo() {
if (__specifiedProperties != null) {
__specifiedProperties.clear();
}
}
protected void checkSpecifiedProperty(String propertyName) {
FunCustodial.checkSpecifiedProperty(this, propertyName, __specifiedProperties);
}
protected void registerSpecifiedProperty(String propertyName) { // basically called by modified property registration
if (__specifiedProperties != null) { // normally false, true if e.g. setting after selected
__specifiedProperties.addPropertyName(propertyName);
}
}
@Override
public boolean hasPrimaryKeyValue() {
return asDocMeta().id() != null;
}
protected EntityUniqueDrivenProperties newUniqueDrivenProperties() {
return new EntityUniqueDrivenProperties();
}
@Override
public Set<String> myuniqueDrivenProperties() {
return __uniqueDrivenProperties.getPropertyNames();
}
@Override
public void myuniqueByProperty(String propertyName) {
__uniqueDrivenProperties.addPropertyName(propertyName);
}
@Override
public void myuniqueByPropertyCancel(String propertyName) {
__uniqueDrivenProperties.remove(propertyName);
}
@Override
public void clearUniqueDrivenInfo() {
__uniqueDrivenProperties.clear();
}
@Override
public void markAsSelect() {
// TODO Auto-generated method stub
}
@Override
public boolean createdBySelect() {
// TODO Auto-generated method stub
return false;
}
@Override
public int instanceHash() {
// TODO Auto-generated method stub
return 0;
}
@Override
public String toStringWithRelation() {
// TODO Auto-generated method stub
return null;
}
@Override
public String buildDisplayString(String name, boolean column, boolean relation) {
// TODO Auto-generated method stub
return null;
}
public abstract Map<String, Object> toSource();
public class DocMeta {
protected String id;
protected Long version;
private RequestOptionCall<IndexRequestBuilder> indexOption;
private RequestOptionCall<DeleteRequestBuilder> deleteOption;
public DocMeta id(String id) {
this.id = id;
myuniqueByProperty("_id");
return this;
}
public String id() {
return id;
}
public DocMeta version(Long version) {
this.version = version;
return this;
}
public Long version() {
return version;
}
public DocMeta indexOption(RequestOptionCall<IndexRequestBuilder> builder) {
this.indexOption = builder;
return this;
}
public RequestOptionCall<IndexRequestBuilder> indexOption() {
return indexOption;
}
public DocMeta deleteOption(RequestOptionCall<DeleteRequestBuilder> builder) {
this.deleteOption = builder;
return this;
}
public RequestOptionCall<DeleteRequestBuilder> deleteOption() {
return deleteOption;
}
}
@FunctionalInterface
public interface RequestOptionCall<OP> {
void callback(OP op);
}
}

View file

@ -0,0 +1,179 @@
package ${request.package}.bsbhv;
import java.util.Map;
import ${request.package}.bsentity.AbstractEntity;
import ${request.package}.bsentity.AbstractEntity.RequestOptionCall;
import ${request.package}.bsentity.dbmeta.${table.camelizedName}Dbm;
import ${request.package}.cbean.${table.camelizedName}CB;
import ${request.package}.exentity.${table.camelizedName};
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class Bs${table.camelizedName}Bhv extends AbstractBehavior<${table.camelizedName}, ${table.camelizedName}CB> {
@Override
public String asTableDbName() {
return "${table.name}";
}
@Override
protected String asIndexEsName() {
return "${table.elasticsearchSettings.index}";
}
@Override
public ${table.camelizedName}Dbm asDBMeta() {
return ${table.camelizedName}Dbm.getInstance();
}
@Override
protected <RESULT extends ${table.camelizedName}> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
#set ($javaNative = ${column.type})
result.set${column.capCamelName}(($javaNative) source.get("${column.name}"));
#end
#end
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<${table.camelizedName}CB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<${table.camelizedName}> selectEntity(CBCall<${table.camelizedName}CB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<${table.camelizedName}> facadeSelectEntity(${table.camelizedName}CB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends ${table.camelizedName}> OptionalEntity<ENTITY> doSelectOptionalEntity(${table.camelizedName}CB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public ${table.camelizedName}CB newConditionBean() {
return new ${table.camelizedName}CB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public ${table.camelizedName} selectEntityWithDeletedCheck(CBCall<${table.camelizedName}CB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<${table.camelizedName}> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<${table.camelizedName}> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends ${table.camelizedName}> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected ${table.camelizedName}CB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends ${table.camelizedName}> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends ${table.camelizedName}> typeOfSelectedEntity() {
return ${table.camelizedName}.class;
}
@Override
protected Class<${table.camelizedName}> typeOfHandlingEntity() {
return ${table.camelizedName}.class;
}
@Override
protected Class<${table.camelizedName}CB> typeOfHandlingConditionBean() {
return ${table.camelizedName}CB.class;
}
public ListResultBean<${table.camelizedName}> selectList(CBCall<${table.camelizedName}CB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<${table.camelizedName}> selectPage(CBCall<${table.camelizedName}CB> cbLambda) {
// TODO same?
return (PagingResultBean<${table.camelizedName}>) facadeSelectList(createCB(cbLambda));
}
public void insert(${table.camelizedName} entity) {
doInsert(entity, null);
}
public void insert(${table.camelizedName} entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(${table.camelizedName} entity) {
doUpdate(entity, null);
}
public void update(${table.camelizedName} entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(${table.camelizedName} entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(${table.camelizedName} entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(${table.camelizedName} entity) {
doDelete(entity, null);
}
public void delete(${table.camelizedName} entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,134 @@
package ${request.package}.cbean.bs;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import ${request.package}.bsentity.dbmeta.${table.camelizedName}Dbm;
import ${request.package}.cbean.${table.camelizedName}CB;
import ${request.package}.cbean.cq.${table.camelizedName}CQ;
import ${request.package}.cbean.cq.bs.Bs${table.camelizedName}CQ;
import org.dbflute.cbean.ConditionQuery;
import org.elasticsearch.action.count.CountRequestBuilder;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.index.query.QueryBuilder;
/**
* @author FreeGen
*/
public class Bs${table.camelizedName}CB extends AbstractConditionBean {
protected Bs${table.camelizedName}CQ _conditionQuery;
protected HpSpecification _specification;
@Override
public ${table.camelizedName}Dbm asDBMeta() {
return ${table.camelizedName}Dbm.getInstance();
}
@Override
public String asTableDbName() {
return "${table.name}";
}
@Override
public boolean hasSpecifiedColumn() {
return _specification != null;
}
@Override
public ConditionQuery localCQ() {
return doGetConditionQuery();
}
public ${table.camelizedName}CB acceptPK(String id) {
assertObjectNotNull("id", id);
Bs${table.camelizedName}CB cb = this;
cb.query().docMeta().setId_Equal(id);
return (${table.camelizedName}CB) this;
}
@Override
public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) {
acceptPK((String)primaryKeyMap.get("_id"));
}
@Override
public CountRequestBuilder build(CountRequestBuilder builder) {
if (_conditionQuery != null) {
QueryBuilder queryBuilder = _conditionQuery.getQuery();
if (queryBuilder != null) {
builder.setQuery(queryBuilder);
}
}
return builder;
}
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
if (_conditionQuery != null) {
QueryBuilder queryBuilder = _conditionQuery.getQuery();
if (queryBuilder != null) {
builder.setQuery(queryBuilder);
}
_conditionQuery.getFieldSortBuilderList().forEach(sort -> {
builder.addSort(sort);
});
}
if (_specification != null) {
builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
}
return builder;
}
public Bs${table.camelizedName}CQ query() {
assertQueryPurpose();
return doGetConditionQuery();
}
protected Bs${table.camelizedName}CQ doGetConditionQuery() {
if (_conditionQuery == null) {
_conditionQuery = createLocalCQ();
}
return _conditionQuery;
}
protected Bs${table.camelizedName}CQ createLocalCQ() {
return new ${table.camelizedName}CQ();
}
public HpSpecification specify() {
assertSpecifyPurpose();
if (_specification == null) {
_specification = new HpSpecification();
}
return _specification;
}
protected void assertQueryPurpose() {
// TODO
}
protected void assertSpecifyPurpose() {
// TODO
}
public static class HpSpecification {
private List<String> columnList = new ArrayList<>();
private void doColumn(String name) {
columnList.add(name);
}
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
public void column${column.capCamelName}() {
doColumn("${column.name}");
}
#end
#end
}
}

View file

@ -0,0 +1,210 @@
package ${request.package}.cbean.cq.bs;
import java.util.Collection;
import ${request.package}.cbean.cq.${table.camelizedName}CQ;
import org.dbflute.cbean.ckey.ConditionKey;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.FilteredQueryBuilder;
import org.elasticsearch.index.query.FuzzyQueryBuilder;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.PrefixQueryBuilder;
import org.elasticsearch.index.query.RangeQueryBuilder;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.index.query.TermsQueryBuilder;
/**
* @author FreeGen
*/
public abstract class Bs${table.camelizedName}CQ extends AbstractConditionQuery {
@Override
public String asTableDbName() {
return "${table.name}";
}
@Override
public String xgetAliasName() {
return "${table.name}";
}
public void filtered(FilteredCall<${table.camelizedName}CQ> filteredLambda) {
filtered(filteredLambda, null);
}
public void filtered(FilteredCall<${table.camelizedName}CQ> filteredLambda, ConditionOptionCall<FilteredQueryBuilder> opLambda) {
${table.camelizedName}CQ query = new ${table.camelizedName}CQ();
filteredLambda.callback(query);
if (!query.queryBuilderList.isEmpty()) {
// TODO filter
FilteredQueryBuilder builder = reqFilteredQ(query.getQuery(), null);
if (opLambda != null) {
opLambda.callback(builder);
}
}
}
public void bool(BoolCall<${table.camelizedName}CQ> boolLambda) {
bool(boolLambda, null);
}
public void bool(BoolCall<${table.camelizedName}CQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
${table.camelizedName}CQ mustQuery = new ${table.camelizedName}CQ();
${table.camelizedName}CQ shouldQuery = new ${table.camelizedName}CQ();
${table.camelizedName}CQ mustNotQuery = new ${table.camelizedName}CQ();
boolLambda.callback(mustQuery, shouldQuery, mustNotQuery);
if (!mustQuery.queryBuilderList.isEmpty() || !shouldQuery.queryBuilderList.isEmpty() || !mustNotQuery.queryBuilderList.isEmpty()) {
BoolQueryBuilder builder = reqBoolCQ(mustQuery.queryBuilderList, shouldQuery.queryBuilderList, mustNotQuery.queryBuilderList);
if (opLambda != null) {
opLambda.callback(builder);
}
}
}
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
#set ($javaNative = ${column.type})
public void set${column.capCamelName}_Term($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_Term(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_Term($javaNative ${column.uncapCamelName}, ConditionOptionCall<TermQueryBuilder> opLambda) {
TermQueryBuilder builder = reqTermQ("${column.name}", ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_Terms(Collection<$javaNative> ${column.uncapCamelName}List) {
set${column.capCamelName}_MatchPhrasePrefix(${column.uncapCamelName}List, null);
}
public void set${column.capCamelName}_MatchPhrasePrefix(Collection<$javaNative> ${column.uncapCamelName}List, ConditionOptionCall<TermsQueryBuilder> opLambda) {
TermsQueryBuilder builder = reqTermsQ("${column.name}", ${column.uncapCamelName}List);
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_InScope(Collection<$javaNative> ${column.uncapCamelName}List) {
set${column.capCamelName}_MatchPhrasePrefix(${column.uncapCamelName}List, null);
}
public void set${column.capCamelName}_InScope(Collection<$javaNative> ${column.uncapCamelName}List, ConditionOptionCall<TermsQueryBuilder> opLambda) {
set${column.capCamelName}_MatchPhrasePrefix(${column.uncapCamelName}List, opLambda);
}
public void set${column.capCamelName}_Match($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_Match(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_Match($javaNative ${column.uncapCamelName}, ConditionOptionCall<MatchQueryBuilder> opLambda) {
MatchQueryBuilder builder = reqMatchQ("${column.name}", ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_MatchPhrase($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_MatchPhrase(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_MatchPhrase($javaNative ${column.uncapCamelName}, ConditionOptionCall<MatchQueryBuilder> opLambda) {
MatchQueryBuilder builder = reqMatchPhraseQ("${column.name}", ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_MatchPhrasePrefix($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_MatchPhrasePrefix(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_MatchPhrasePrefix($javaNative ${column.uncapCamelName}, ConditionOptionCall<MatchQueryBuilder> opLambda) {
MatchQueryBuilder builder = reqMatchPhrasePrefixQ("${column.name}", ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_Fuzzy($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_Fuzzy(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_Fuzzy($javaNative ${column.uncapCamelName}, ConditionOptionCall<FuzzyQueryBuilder> opLambda) {
FuzzyQueryBuilder builder = reqFuzzyQ("${column.name}", ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
#if ($javaNative == "String")
public void set${column.capCamelName}_Prefix($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_Prefix(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_Prefix($javaNative ${column.uncapCamelName}, ConditionOptionCall<PrefixQueryBuilder> opLambda) {
PrefixQueryBuilder builder = reqPrefixQ("${column.name}", ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
#end
public void set${column.capCamelName}_GreaterThan($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_GreaterThan(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_GreaterThan($javaNative ${column.uncapCamelName}, ConditionOptionCall<RangeQueryBuilder> opLambda) {
RangeQueryBuilder builder = reqRangeQ("${column.name}", ConditionKey.CK_GREATER_THAN, ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_LessThan($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_LessThan(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_LessThan($javaNative ${column.uncapCamelName}, ConditionOptionCall<RangeQueryBuilder> opLambda) {
RangeQueryBuilder builder = reqRangeQ("${column.name}", ConditionKey.CK_LESS_THAN, ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_GreaterEqual($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_GreaterEqual(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_GreaterEqual($javaNative ${column.uncapCamelName}, ConditionOptionCall<RangeQueryBuilder> opLambda) {
RangeQueryBuilder builder = reqRangeQ("${column.name}", ConditionKey.CK_GREATER_EQUAL, ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public void set${column.capCamelName}_LessEqual($javaNative ${column.uncapCamelName}) {
set${column.capCamelName}_LessEqual(${column.uncapCamelName}, null);
}
public void set${column.capCamelName}_LessEqual($javaNative ${column.uncapCamelName}, ConditionOptionCall<RangeQueryBuilder> opLambda) {
RangeQueryBuilder builder = reqRangeQ("${column.name}", ConditionKey.CK_LESS_EQUAL, ${column.uncapCamelName});
if (opLambda != null) {
opLambda.callback(builder);
}
}
public Bs${table.camelizedName}CQ addOrderBy_${column.capCamelName}_Asc() {
regOBA("${column.name}");
return this;
}
public Bs${table.camelizedName}CQ addOrderBy_${column.capCamelName}_Desc() {
regOBD("${column.name}");
return this;
}
#end
#end
}

View file

@ -0,0 +1,78 @@
package ${request.package}.bsentity;
import java.util.HashMap;
import java.util.Map;
import ${request.package}.bsentity.dbmeta.${table.camelizedName}Dbm;
#if ($table.hasRefColumn)
import ${request.package}.exentity.*;
#end
/**
* ${table.comment}
* @author FreeGen
*/
public class Bs${table.camelizedName} extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public ${table.camelizedName}Dbm asDBMeta() {
return ${table.camelizedName}Dbm.getInstance();
}
@Override
public String asTableDbName() {
return "${table.name}";
}
// ===================================================================================
// Attribute
// =========
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
#set ($javaNative = ${column.type})
#elseif ($column.isRefColumn)
#set ($javaNative = ${column.camelizedName})
#end
/** ${column.name} */
protected ${javaNative} ${column.uncapCamelName};
#end
// [Referrers] *comment only
#foreach ($referrer in $table.referrerList)
// o ${referrer.name}
#end
// ===================================================================================
// Accessor
// ========
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
#set ($javaNative = ${column.type})
#elseif ($column.isRefColumn)
#set ($javaNative = ${column.camelizedName})
#end
public ${javaNative} get${column.capCamelName}() {
return ${column.uncapCamelName};
}
public void set${column.capCamelName}(${javaNative} value) {
${column.uncapCamelName} = value;
}
#end
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
#foreach ($column in $table.columnList)
#if ($column.isNormalColumn)
if (${column.uncapCamelName} != null) {
sourceMap.put("${column.name}", ${column.uncapCamelName});
}
#end
#end
return sourceMap;
}
}

View file

@ -0,0 +1,154 @@
package ${request.package}.bsentity.dbmeta;
import java.util.List;
import java.util.Map;
import org.dbflute.Entity;
import org.dbflute.dbmeta.AbstractDBMeta;
import org.dbflute.dbmeta.info.ColumnInfo;
import org.dbflute.dbmeta.info.UniqueInfo;
import org.dbflute.dbmeta.name.TableSqlName;
import org.dbflute.dbway.DBDef;
public class ${table.camelizedName}Dbm extends AbstractDBMeta {
// ===================================================================================
// Singleton
// =========
private static final ${table.camelizedName}Dbm _instance = new ${table.camelizedName}Dbm();
private ${table.camelizedName}Dbm() {
}
public static ${table.camelizedName}Dbm getInstance() {
return _instance;
}
@Override
public String getProjectName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getProjectPrefix() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getGenerationGapBasePrefix() {
// TODO Auto-generated method stub
return null;
}
@Override
public DBDef getCurrentDBDef() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getTableDbName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getTableDispName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getTablePropertyName() {
// TODO Auto-generated method stub
return null;
}
@Override
public TableSqlName getTableSqlName() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean hasPrimaryKey() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean hasCompoundPrimaryKey() {
// TODO Auto-generated method stub
return false;
}
@Override
public String getEntityTypeName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getConditionBeanTypeName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getBehaviorTypeName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<? extends Entity> getEntityType() {
// TODO Auto-generated method stub
return null;
}
@Override
public Entity newEntity() {
// TODO Auto-generated method stub
return null;
}
@Override
public void acceptPrimaryKeyMap(Entity entity, Map<String, ? extends Object> primaryKeyMap) {
// TODO Auto-generated method stub
}
@Override
public void acceptAllColumnMap(Entity entity, Map<String, ? extends Object> allColumnMap) {
// TODO Auto-generated method stub
}
@Override
public Map<String, Object> extractPrimaryKeyMap(Entity entity) {
// TODO Auto-generated method stub
return null;
}
@Override
public Map<String, Object> extractAllColumnMap(Entity entity) {
// TODO Auto-generated method stub
return null;
}
@Override
protected List<ColumnInfo> ccil() {
// TODO Auto-generated method stub
return null;
}
@Override
protected UniqueInfo cpui() {
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,50 @@
package ${request.package}.cbean.result;
import org.dbflute.cbean.result.PagingResultBean;
public class EsPagingResultBean<ENTITY> extends PagingResultBean<ENTITY> {
private static final long serialVersionUID = 1L;
protected long took;
private int totalShards;
private int successfulShards;
private int failedShards;
public long getTook() {
return took;
}
public void setTook(long took) {
this.took = took;
}
public int getTotalShards() {
return totalShards;
}
public void setTotalShards(int totalShards) {
this.totalShards = totalShards;
}
public int getSuccessfulShards() {
return successfulShards;
}
public void setSuccessfulShards(int successfulShards) {
this.successfulShards = successfulShards;
}
public int getFailedShards() {
return failedShards;
}
public void setFailedShards(int failedShards) {
this.failedShards = failedShards;
}
}

View file

@ -0,0 +1,10 @@
package ${request.package}.exbhv;
import ${request.package}.bsbhv.Bs${table.camelizedName}Bhv;
/**
* @author FreeGen
*/
public class ${table.camelizedName}Bhv extends Bs${table.camelizedName}Bhv {
}

View file

@ -0,0 +1,9 @@
package ${request.package}.cbean;
import ${request.package}.cbean.bs.Bs${table.camelizedName}CB;
/**
* @author FreeGen
*/
public class ${table.camelizedName}CB extends Bs${table.camelizedName}CB {
}

View file

@ -0,0 +1,9 @@
package ${request.package}.cbean.cq;
import ${request.package}.cbean.cq.bs.Bs${table.camelizedName}CQ;
/**
* @author FreeGen
*/
public class ${table.camelizedName}CQ extends Bs${table.camelizedName}CQ {
}

View file

@ -0,0 +1,11 @@
package ${request.package}.exentity;
import ${request.package}.bsentity.Bs${table.camelizedName};
/**
* @author FreeGen
*/
public class ${table.camelizedName} extends Bs${table.camelizedName} {
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,69 @@
package ${request.package}.cbean.sqlclause;
import org.dbflute.cbean.sqlclause.AbstractSqlClause;
import org.dbflute.dbway.DBWay;
public class SqlClauseEs extends AbstractSqlClause {
private static final long serialVersionUID = 1L;
public SqlClauseEs(String tableDbName) {
super(tableDbName);
}
@Override
public void lockForUpdate() {
// TODO Auto-generated method stub
}
@Override
public DBWay dbway() {
// TODO Auto-generated method stub
return null;
}
@Override
protected void doFetchFirst() {
// TODO Auto-generated method stub
}
@Override
protected void doFetchPage() {
// TODO Auto-generated method stub
}
@Override
protected void doClearFetchPageClause() {
// TODO Auto-generated method stub
}
@Override
protected String createSelectHint() {
// TODO Auto-generated method stub
return null;
}
@Override
protected String createFromBaseTableHint() {
// TODO Auto-generated method stub
return null;
}
@Override
protected String createFromHint() {
// TODO Auto-generated method stub
return null;
}
@Override
protected String createSqlSuffix() {
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,4 @@
Directory for log files of DBFlute tasks
If your execution of DBFlute task fails,
look the log file "dbflute.log" for debug.

18
dbflute_fess/manage.bat Normal file
View file

@ -0,0 +1,18 @@
@echo off
setlocal
%~d0
cd %~p0
call _project.bat
:: tilde to remove double quotation
set FIRST_ARG=%~1
if "%FIRST_ARG%"=="" set FIRST_ARG=""
set SECOND_ARG=%2
if "%SECOND_ARG%"=="" set SECOND_ARG=""
call %DBFLUTE_HOME%\etc\cmd\_df-manage.cmd %MY_PROPERTIES_PATH% "%FIRST_ARG%" %SECOND_ARG%
if "%pause_at_end%"=="y" (
pause
)

14
dbflute_fess/manage.sh Normal file
View file

@ -0,0 +1,14 @@
#!/bin/bash
cd `dirname $0`
. ./_project.sh
FIRST_ARG=$1
SECOND_ARG=$2
sh $DBFLUTE_HOME/etc/cmd/_df-manage.sh $MY_PROPERTIES_PATH $FIRST_ARG $SECOND_ARG
taskReturnCode=$?
if [ $taskReturnCode -ne 0 ];then
exit $taskReturnCode;
fi

View file

@ -0,0 +1,3 @@
Directory for auto-generated documents
e.g. SchemaHTML, HistoryHTML

View file

@ -0,0 +1,50 @@
Directory for ReplaceSchema task
replace-schema-*.sql:
DDL statements for creation of your schema.
You should write your own DDL statements in this file.
(A SQL separator is semicolon ";")
take-finally-*.sql:
SQL statements for check loaded data (or DDL after data loading)
You should write your own SQL statements in this file.
(basically same specifications as replace-schema.sql)
The "data" directory is for data loading like this:
/- - - - - - - - - - - - - - - - - - - -
playsql
|-data
|-common
| |-xls
| |-10-master.xls
| |-defaultValueMap.dataprop
|-ut
|-xls
|-20-member.xls
|-30-product.xls
|-defaultValueMap.dataprop
- - - - - - - - - -/
The format of a xls file is like this:
/- - - - - - - - - - - - - - - - - - - -
|MEMBER_ID|MEMBER_NAME|BIRTHDATE |
| 1|Stojkovic |1965/03/03|
| 2|Savicevic | |
| 3|... |... |
(Sheet)
MEMBER / MEMBER_LOGIN / MEMBER_SECURITY
- - - - - - - - - -/
The defaultValueMap.dataprop is for common columns like this:
/- - - - - - - - - - - - - - - - - - - -
map:{
; REGISTER_DATETIME = sysdate
; REGISTER_USER = foo
; REGISTER_PROCESS = bar
; UPDATE_DATETIME = sysdate
; UPDATE_USER = foo
; UPDATE_PROCESS = bar
; VERSION_NO = 0
}
- - - - - - - - - -/

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,4 @@
Directory for files of schema info
Files are auto-generated by DBFlute tasks.
Basically you don't need to touch this directory.

11
pom.xml
View file

@ -203,6 +203,17 @@
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-SNAPSHOT</version>
</plugin>
<plugin>
<groupId>org.dbflute</groupId>
<artifactId>dbflute-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<dbfluteVersion>${dbflute.version}</dbfluteVersion>
<packageBase>org.codelibs.fess.db</packageBase>
<clientProject>fess</clientProject>
<dbfluteClientDir>${basedir}/dbflute_fess</dbfluteClientDir>
</configuration>
</plugin>
</plugins>
</build>
<pluginRepositories>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,137 @@
package org.codelibs.fess.es.bsbhv;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.DocMeta;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.cbean.bs.AbstractConditionBean;
import org.codelibs.fess.es.cbean.result.EsPagingResultBean;
import org.dbflute.Entity;
import org.dbflute.bhv.AbstractBehaviorWritable;
import org.dbflute.bhv.writable.DeleteOption;
import org.dbflute.bhv.writable.InsertOption;
import org.dbflute.bhv.writable.UpdateOption;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.elasticsearch.action.count.CountRequestBuilder;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.search.SearchHits;
public abstract class AbstractBehavior<ENTITY extends Entity, CB extends ConditionBean> extends AbstractBehaviorWritable<ENTITY, CB> {
@Resource
protected Client client;
protected abstract String asIndexEsName();
protected abstract <RESULT extends ENTITY> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType);
@Override
protected int delegateSelectCountUniquely(ConditionBean cb) {
// TODO check response and cast problem
CountRequestBuilder builder = client.prepareCount(asIndexEsName()).setTypes(asTableDbName());
return (int) ((AbstractConditionBean) cb).build(builder).execute().actionGet().getCount();
}
protected <RESULT extends ENTITY> List<RESULT> delegateSelectList(ConditionBean cb, Class<? extends RESULT> entityType) {
// TODO check response
SearchRequestBuilder builder = client.prepareSearch(asIndexEsName()).setTypes(asTableDbName());
if (cb.isFetchScopeEffective()) {
builder.setFrom(cb.getFetchStartIndex());
builder.setSize(cb.getFetchSize());
}
((AbstractConditionBean) cb).request().build(builder);
SearchResponse response = ((AbstractConditionBean) cb).build(builder).execute().actionGet();
EsPagingResultBean<RESULT> list = new EsPagingResultBean<>();
SearchHits searchHits = response.getHits();
searchHits.forEach(hit -> {
Map<String, Object> source = hit.getSource();
RESULT entity = createEntity(source, entityType);
DocMeta docMeta = ((AbstractEntity) entity).asDocMeta();
docMeta.id(hit.getId());
docMeta.version(hit.getVersion());
list.add(entity);
});
list.setAllRecordCount((int) searchHits.totalHits());
list.setPageSize(cb.getFetchSize());
list.setCurrentPageNumber(cb.getFetchPageNumber());
list.setTook(response.getTookInMillis());
list.setTotalShards(response.getTotalShards());
list.setSuccessfulShards(response.getSuccessfulShards());
list.setFailedShards(response.getFailedShards());
// TODO others
return list;
}
@Override
protected Number doReadNextVal() {
String msg = "This table is NOT related to sequence: " + asTableDbName();
throw new UnsupportedOperationException(msg);
}
@Override
protected <RESULT extends Entity> ListResultBean<RESULT> createListResultBean(ConditionBean cb, List<RESULT> selectedList) {
if (selectedList instanceof EsPagingResultBean) {
return (ListResultBean<RESULT>) selectedList;
}
throw new IllegalBehaviorStateException("selectedList is not EsPagingResultBean.");
}
@Override
protected int delegateInsert(Entity entity, InsertOption<? extends ConditionBean> option) {
AbstractEntity esEntity = (AbstractEntity) entity;
IndexRequestBuilder builder = client.prepareIndex(asIndexEsName(), asTableDbName()).setSource(esEntity.toSource());
RequestOptionCall<IndexRequestBuilder> indexOption = esEntity.asDocMeta().indexOption();
if (indexOption != null) {
indexOption.callback(builder);
}
IndexResponse response = builder.execute().actionGet();
esEntity.asDocMeta().id(response.getId());
return response.isCreated() ? 1 : 0;
}
@Override
protected int delegateUpdate(Entity entity, UpdateOption<? extends ConditionBean> option) {
AbstractEntity esEntity = (AbstractEntity) entity;
IndexRequestBuilder builder =
client.prepareIndex(asIndexEsName(), asTableDbName(), esEntity.asDocMeta().id()).setSource(esEntity.toSource());
RequestOptionCall<IndexRequestBuilder> indexOption = esEntity.asDocMeta().indexOption();
if (indexOption != null) {
indexOption.callback(builder);
}
Long version = esEntity.asDocMeta().version();
if (version != null && version.longValue() != -1) {
builder.setVersion(version);
}
IndexResponse response = builder.execute().actionGet();
return 1;
}
@Override
protected int delegateDelete(Entity entity, DeleteOption<? extends ConditionBean> option) {
AbstractEntity esEntity = (AbstractEntity) entity;
DeleteRequestBuilder builder = client.prepareDelete(asIndexEsName(), asTableDbName(), esEntity.asDocMeta().id());
RequestOptionCall<DeleteRequestBuilder> deleteOption = esEntity.asDocMeta().deleteOption();
if (deleteOption != null) {
deleteOption.callback(builder);
}
DeleteResponse response = builder.execute().actionGet();
return response.isFound() ? 1 : 0;
}
}

View file

@ -0,0 +1,180 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.BoostDocumentRuleDbm;
import org.codelibs.fess.es.cbean.BoostDocumentRuleCB;
import org.codelibs.fess.es.exentity.BoostDocumentRule;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsBoostDocumentRuleBhv extends AbstractBehavior<BoostDocumentRule, BoostDocumentRuleCB> {
@Override
public String asTableDbName() {
return "boost_document_rule";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public BoostDocumentRuleDbm asDBMeta() {
return BoostDocumentRuleDbm.getInstance();
}
@Override
protected <RESULT extends BoostDocumentRule> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setBoostExpr((String) source.get("boostExpr"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
result.setUrlExpr((String) source.get("urlExpr"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<BoostDocumentRuleCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<BoostDocumentRule> selectEntity(CBCall<BoostDocumentRuleCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<BoostDocumentRule> facadeSelectEntity(BoostDocumentRuleCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends BoostDocumentRule> OptionalEntity<ENTITY> doSelectOptionalEntity(BoostDocumentRuleCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public BoostDocumentRuleCB newConditionBean() {
return new BoostDocumentRuleCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public BoostDocumentRule selectEntityWithDeletedCheck(CBCall<BoostDocumentRuleCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<BoostDocumentRule> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<BoostDocumentRule> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends BoostDocumentRule> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected BoostDocumentRuleCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends BoostDocumentRule> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends BoostDocumentRule> typeOfSelectedEntity() {
return BoostDocumentRule.class;
}
@Override
protected Class<BoostDocumentRule> typeOfHandlingEntity() {
return BoostDocumentRule.class;
}
@Override
protected Class<BoostDocumentRuleCB> typeOfHandlingConditionBean() {
return BoostDocumentRuleCB.class;
}
public ListResultBean<BoostDocumentRule> selectList(CBCall<BoostDocumentRuleCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<BoostDocumentRule> selectPage(CBCall<BoostDocumentRuleCB> cbLambda) {
// TODO same?
return (PagingResultBean<BoostDocumentRule>) facadeSelectList(createCB(cbLambda));
}
public void insert(BoostDocumentRule entity) {
doInsert(entity, null);
}
public void insert(BoostDocumentRule entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(BoostDocumentRule entity) {
doUpdate(entity, null);
}
public void update(BoostDocumentRule entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(BoostDocumentRule entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(BoostDocumentRule entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(BoostDocumentRule entity) {
doDelete(entity, null);
}
public void delete(BoostDocumentRule entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.ClickLogDbm;
import org.codelibs.fess.es.cbean.ClickLogCB;
import org.codelibs.fess.es.exentity.ClickLog;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsClickLogBhv extends AbstractBehavior<ClickLog, ClickLogCB> {
@Override
public String asTableDbName() {
return "click_log";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public ClickLogDbm asDBMeta() {
return ClickLogDbm.getInstance();
}
@Override
protected <RESULT extends ClickLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setId((String) source.get("id"));
result.setRequestedTime((Long) source.get("requestedTime"));
result.setSearchLogId((String) source.get("searchLogId"));
result.setUrl((String) source.get("url"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<ClickLogCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<ClickLog> selectEntity(CBCall<ClickLogCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<ClickLog> facadeSelectEntity(ClickLogCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends ClickLog> OptionalEntity<ENTITY> doSelectOptionalEntity(ClickLogCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public ClickLogCB newConditionBean() {
return new ClickLogCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public ClickLog selectEntityWithDeletedCheck(CBCall<ClickLogCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<ClickLog> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<ClickLog> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends ClickLog> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected ClickLogCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends ClickLog> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends ClickLog> typeOfSelectedEntity() {
return ClickLog.class;
}
@Override
protected Class<ClickLog> typeOfHandlingEntity() {
return ClickLog.class;
}
@Override
protected Class<ClickLogCB> typeOfHandlingConditionBean() {
return ClickLogCB.class;
}
public ListResultBean<ClickLog> selectList(CBCall<ClickLogCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<ClickLog> selectPage(CBCall<ClickLogCB> cbLambda) {
// TODO same?
return (PagingResultBean<ClickLog>) facadeSelectList(createCB(cbLambda));
}
public void insert(ClickLog entity) {
doInsert(entity, null);
}
public void insert(ClickLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(ClickLog entity) {
doUpdate(entity, null);
}
public void update(ClickLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(ClickLog entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(ClickLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(ClickLog entity) {
doDelete(entity, null);
}
public void delete(ClickLog entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,177 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.CrawlingSessionDbm;
import org.codelibs.fess.es.cbean.CrawlingSessionCB;
import org.codelibs.fess.es.exentity.CrawlingSession;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsCrawlingSessionBhv extends AbstractBehavior<CrawlingSession, CrawlingSessionCB> {
@Override
public String asTableDbName() {
return "crawling_session";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public CrawlingSessionDbm asDBMeta() {
return CrawlingSessionDbm.getInstance();
}
@Override
protected <RESULT extends CrawlingSession> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedTime((Long) source.get("createdTime"));
result.setExpiredTime((Long) source.get("expiredTime"));
result.setId((String) source.get("id"));
result.setName((String) source.get("name"));
result.setSessionId((String) source.get("sessionId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<CrawlingSessionCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<CrawlingSession> selectEntity(CBCall<CrawlingSessionCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<CrawlingSession> facadeSelectEntity(CrawlingSessionCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends CrawlingSession> OptionalEntity<ENTITY> doSelectOptionalEntity(CrawlingSessionCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public CrawlingSessionCB newConditionBean() {
return new CrawlingSessionCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public CrawlingSession selectEntityWithDeletedCheck(CBCall<CrawlingSessionCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<CrawlingSession> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<CrawlingSession> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends CrawlingSession> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected CrawlingSessionCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends CrawlingSession> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends CrawlingSession> typeOfSelectedEntity() {
return CrawlingSession.class;
}
@Override
protected Class<CrawlingSession> typeOfHandlingEntity() {
return CrawlingSession.class;
}
@Override
protected Class<CrawlingSessionCB> typeOfHandlingConditionBean() {
return CrawlingSessionCB.class;
}
public ListResultBean<CrawlingSession> selectList(CBCall<CrawlingSessionCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<CrawlingSession> selectPage(CBCall<CrawlingSessionCB> cbLambda) {
// TODO same?
return (PagingResultBean<CrawlingSession>) facadeSelectList(createCB(cbLambda));
}
public void insert(CrawlingSession entity) {
doInsert(entity, null);
}
public void insert(CrawlingSession entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(CrawlingSession entity) {
doUpdate(entity, null);
}
public void update(CrawlingSession entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(CrawlingSession entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(CrawlingSession entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(CrawlingSession entity) {
doDelete(entity, null);
}
public void delete(CrawlingSession entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,177 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.CrawlingSessionInfoDbm;
import org.codelibs.fess.es.cbean.CrawlingSessionInfoCB;
import org.codelibs.fess.es.exentity.CrawlingSessionInfo;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsCrawlingSessionInfoBhv extends AbstractBehavior<CrawlingSessionInfo, CrawlingSessionInfoCB> {
@Override
public String asTableDbName() {
return "crawling_session_info";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public CrawlingSessionInfoDbm asDBMeta() {
return CrawlingSessionInfoDbm.getInstance();
}
@Override
protected <RESULT extends CrawlingSessionInfo> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCrawlingSessionId((String) source.get("crawlingSessionId"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setKey((String) source.get("key"));
result.setValue((String) source.get("value"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<CrawlingSessionInfoCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<CrawlingSessionInfo> selectEntity(CBCall<CrawlingSessionInfoCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<CrawlingSessionInfo> facadeSelectEntity(CrawlingSessionInfoCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends CrawlingSessionInfo> OptionalEntity<ENTITY> doSelectOptionalEntity(CrawlingSessionInfoCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public CrawlingSessionInfoCB newConditionBean() {
return new CrawlingSessionInfoCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public CrawlingSessionInfo selectEntityWithDeletedCheck(CBCall<CrawlingSessionInfoCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<CrawlingSessionInfo> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<CrawlingSessionInfo> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends CrawlingSessionInfo> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected CrawlingSessionInfoCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends CrawlingSessionInfo> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends CrawlingSessionInfo> typeOfSelectedEntity() {
return CrawlingSessionInfo.class;
}
@Override
protected Class<CrawlingSessionInfo> typeOfHandlingEntity() {
return CrawlingSessionInfo.class;
}
@Override
protected Class<CrawlingSessionInfoCB> typeOfHandlingConditionBean() {
return CrawlingSessionInfoCB.class;
}
public ListResultBean<CrawlingSessionInfo> selectList(CBCall<CrawlingSessionInfoCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<CrawlingSessionInfo> selectPage(CBCall<CrawlingSessionInfoCB> cbLambda) {
// TODO same?
return (PagingResultBean<CrawlingSessionInfo>) facadeSelectList(createCB(cbLambda));
}
public void insert(CrawlingSessionInfo entity) {
doInsert(entity, null);
}
public void insert(CrawlingSessionInfo entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(CrawlingSessionInfo entity) {
doUpdate(entity, null);
}
public void update(CrawlingSessionInfo entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(CrawlingSessionInfo entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(CrawlingSessionInfo entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(CrawlingSessionInfo entity) {
doDelete(entity, null);
}
public void delete(CrawlingSessionInfo entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,183 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.DataConfigDbm;
import org.codelibs.fess.es.cbean.DataConfigCB;
import org.codelibs.fess.es.exentity.DataConfig;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsDataConfigBhv extends AbstractBehavior<DataConfig, DataConfigCB> {
@Override
public String asTableDbName() {
return "data_config";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public DataConfigDbm asDBMeta() {
return DataConfigDbm.getInstance();
}
@Override
protected <RESULT extends DataConfig> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAvailable((Boolean) source.get("available"));
result.setBoost((Float) source.get("boost"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setHandlerName((String) source.get("handlerName"));
result.setHandlerParameter((String) source.get("handlerParameter"));
result.setHandlerScript((String) source.get("handlerScript"));
result.setId((String) source.get("id"));
result.setName((String) source.get("name"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<DataConfigCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<DataConfig> selectEntity(CBCall<DataConfigCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<DataConfig> facadeSelectEntity(DataConfigCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends DataConfig> OptionalEntity<ENTITY> doSelectOptionalEntity(DataConfigCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public DataConfigCB newConditionBean() {
return new DataConfigCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public DataConfig selectEntityWithDeletedCheck(CBCall<DataConfigCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<DataConfig> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<DataConfig> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends DataConfig> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected DataConfigCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends DataConfig> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends DataConfig> typeOfSelectedEntity() {
return DataConfig.class;
}
@Override
protected Class<DataConfig> typeOfHandlingEntity() {
return DataConfig.class;
}
@Override
protected Class<DataConfigCB> typeOfHandlingConditionBean() {
return DataConfigCB.class;
}
public ListResultBean<DataConfig> selectList(CBCall<DataConfigCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<DataConfig> selectPage(CBCall<DataConfigCB> cbLambda) {
// TODO same?
return (PagingResultBean<DataConfig>) facadeSelectList(createCB(cbLambda));
}
public void insert(DataConfig entity) {
doInsert(entity, null);
}
public void insert(DataConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(DataConfig entity) {
doUpdate(entity, null);
}
public void update(DataConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(DataConfig entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(DataConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(DataConfig entity) {
doDelete(entity, null);
}
public void delete(DataConfig entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.DataConfigToLabelDbm;
import org.codelibs.fess.es.cbean.DataConfigToLabelCB;
import org.codelibs.fess.es.exentity.DataConfigToLabel;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsDataConfigToLabelBhv extends AbstractBehavior<DataConfigToLabel, DataConfigToLabelCB> {
@Override
public String asTableDbName() {
return "data_config_to_label";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public DataConfigToLabelDbm asDBMeta() {
return DataConfigToLabelDbm.getInstance();
}
@Override
protected <RESULT extends DataConfigToLabel> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setDataConfigId((String) source.get("dataConfigId"));
result.setId((String) source.get("id"));
result.setLabelTypeId((String) source.get("labelTypeId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<DataConfigToLabelCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<DataConfigToLabel> selectEntity(CBCall<DataConfigToLabelCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<DataConfigToLabel> facadeSelectEntity(DataConfigToLabelCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends DataConfigToLabel> OptionalEntity<ENTITY> doSelectOptionalEntity(DataConfigToLabelCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public DataConfigToLabelCB newConditionBean() {
return new DataConfigToLabelCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public DataConfigToLabel selectEntityWithDeletedCheck(CBCall<DataConfigToLabelCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<DataConfigToLabel> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<DataConfigToLabel> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends DataConfigToLabel> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected DataConfigToLabelCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends DataConfigToLabel> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends DataConfigToLabel> typeOfSelectedEntity() {
return DataConfigToLabel.class;
}
@Override
protected Class<DataConfigToLabel> typeOfHandlingEntity() {
return DataConfigToLabel.class;
}
@Override
protected Class<DataConfigToLabelCB> typeOfHandlingConditionBean() {
return DataConfigToLabelCB.class;
}
public ListResultBean<DataConfigToLabel> selectList(CBCall<DataConfigToLabelCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<DataConfigToLabel> selectPage(CBCall<DataConfigToLabelCB> cbLambda) {
// TODO same?
return (PagingResultBean<DataConfigToLabel>) facadeSelectList(createCB(cbLambda));
}
public void insert(DataConfigToLabel entity) {
doInsert(entity, null);
}
public void insert(DataConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(DataConfigToLabel entity) {
doUpdate(entity, null);
}
public void update(DataConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(DataConfigToLabel entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(DataConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(DataConfigToLabel entity) {
doDelete(entity, null);
}
public void delete(DataConfigToLabel entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.DataConfigToRoleDbm;
import org.codelibs.fess.es.cbean.DataConfigToRoleCB;
import org.codelibs.fess.es.exentity.DataConfigToRole;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsDataConfigToRoleBhv extends AbstractBehavior<DataConfigToRole, DataConfigToRoleCB> {
@Override
public String asTableDbName() {
return "data_config_to_role";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public DataConfigToRoleDbm asDBMeta() {
return DataConfigToRoleDbm.getInstance();
}
@Override
protected <RESULT extends DataConfigToRole> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setDataConfigId((String) source.get("dataConfigId"));
result.setId((String) source.get("id"));
result.setRoleTypeId((String) source.get("roleTypeId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<DataConfigToRoleCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<DataConfigToRole> selectEntity(CBCall<DataConfigToRoleCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<DataConfigToRole> facadeSelectEntity(DataConfigToRoleCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends DataConfigToRole> OptionalEntity<ENTITY> doSelectOptionalEntity(DataConfigToRoleCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public DataConfigToRoleCB newConditionBean() {
return new DataConfigToRoleCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public DataConfigToRole selectEntityWithDeletedCheck(CBCall<DataConfigToRoleCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<DataConfigToRole> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<DataConfigToRole> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends DataConfigToRole> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected DataConfigToRoleCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends DataConfigToRole> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends DataConfigToRole> typeOfSelectedEntity() {
return DataConfigToRole.class;
}
@Override
protected Class<DataConfigToRole> typeOfHandlingEntity() {
return DataConfigToRole.class;
}
@Override
protected Class<DataConfigToRoleCB> typeOfHandlingConditionBean() {
return DataConfigToRoleCB.class;
}
public ListResultBean<DataConfigToRole> selectList(CBCall<DataConfigToRoleCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<DataConfigToRole> selectPage(CBCall<DataConfigToRoleCB> cbLambda) {
// TODO same?
return (PagingResultBean<DataConfigToRole>) facadeSelectList(createCB(cbLambda));
}
public void insert(DataConfigToRole entity) {
doInsert(entity, null);
}
public void insert(DataConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(DataConfigToRole entity) {
doUpdate(entity, null);
}
public void update(DataConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(DataConfigToRole entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(DataConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(DataConfigToRole entity) {
doDelete(entity, null);
}
public void delete(DataConfigToRole entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,179 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.FailureUrlDbm;
import org.codelibs.fess.es.cbean.FailureUrlCB;
import org.codelibs.fess.es.exentity.FailureUrl;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsFailureUrlBhv extends AbstractBehavior<FailureUrl, FailureUrlCB> {
@Override
public String asTableDbName() {
return "failure_url";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public FailureUrlDbm asDBMeta() {
return FailureUrlDbm.getInstance();
}
@Override
protected <RESULT extends FailureUrl> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setConfigId((String) source.get("configId"));
result.setErrorCount((Integer) source.get("errorCount"));
result.setErrorLog((String) source.get("errorLog"));
result.setErrorName((String) source.get("errorName"));
result.setId((String) source.get("id"));
result.setLastAccessTime((Long) source.get("lastAccessTime"));
result.setThreadName((String) source.get("threadName"));
result.setUrl((String) source.get("url"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<FailureUrlCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<FailureUrl> selectEntity(CBCall<FailureUrlCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<FailureUrl> facadeSelectEntity(FailureUrlCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends FailureUrl> OptionalEntity<ENTITY> doSelectOptionalEntity(FailureUrlCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public FailureUrlCB newConditionBean() {
return new FailureUrlCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public FailureUrl selectEntityWithDeletedCheck(CBCall<FailureUrlCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<FailureUrl> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<FailureUrl> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends FailureUrl> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected FailureUrlCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends FailureUrl> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends FailureUrl> typeOfSelectedEntity() {
return FailureUrl.class;
}
@Override
protected Class<FailureUrl> typeOfHandlingEntity() {
return FailureUrl.class;
}
@Override
protected Class<FailureUrlCB> typeOfHandlingConditionBean() {
return FailureUrlCB.class;
}
public ListResultBean<FailureUrl> selectList(CBCall<FailureUrlCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<FailureUrl> selectPage(CBCall<FailureUrlCB> cbLambda) {
// TODO same?
return (PagingResultBean<FailureUrl>) facadeSelectList(createCB(cbLambda));
}
public void insert(FailureUrl entity) {
doInsert(entity, null);
}
public void insert(FailureUrl entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(FailureUrl entity) {
doUpdate(entity, null);
}
public void update(FailureUrl entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(FailureUrl entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(FailureUrl entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(FailureUrl entity) {
doDelete(entity, null);
}
public void delete(FailureUrl entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.FavoriteLogDbm;
import org.codelibs.fess.es.cbean.FavoriteLogCB;
import org.codelibs.fess.es.exentity.FavoriteLog;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsFavoriteLogBhv extends AbstractBehavior<FavoriteLog, FavoriteLogCB> {
@Override
public String asTableDbName() {
return "favorite_log";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public FavoriteLogDbm asDBMeta() {
return FavoriteLogDbm.getInstance();
}
@Override
protected <RESULT extends FavoriteLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setUrl((String) source.get("url"));
result.setUserInfoId((String) source.get("userInfoId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<FavoriteLogCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<FavoriteLog> selectEntity(CBCall<FavoriteLogCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<FavoriteLog> facadeSelectEntity(FavoriteLogCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends FavoriteLog> OptionalEntity<ENTITY> doSelectOptionalEntity(FavoriteLogCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public FavoriteLogCB newConditionBean() {
return new FavoriteLogCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public FavoriteLog selectEntityWithDeletedCheck(CBCall<FavoriteLogCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<FavoriteLog> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<FavoriteLog> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends FavoriteLog> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected FavoriteLogCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends FavoriteLog> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends FavoriteLog> typeOfSelectedEntity() {
return FavoriteLog.class;
}
@Override
protected Class<FavoriteLog> typeOfHandlingEntity() {
return FavoriteLog.class;
}
@Override
protected Class<FavoriteLogCB> typeOfHandlingConditionBean() {
return FavoriteLogCB.class;
}
public ListResultBean<FavoriteLog> selectList(CBCall<FavoriteLogCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<FavoriteLog> selectPage(CBCall<FavoriteLogCB> cbLambda) {
// TODO same?
return (PagingResultBean<FavoriteLog>) facadeSelectList(createCB(cbLambda));
}
public void insert(FavoriteLog entity) {
doInsert(entity, null);
}
public void insert(FavoriteLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(FavoriteLog entity) {
doUpdate(entity, null);
}
public void update(FavoriteLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(FavoriteLog entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(FavoriteLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(FavoriteLog entity) {
doDelete(entity, null);
}
public void delete(FavoriteLog entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,184 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.FileAuthenticationDbm;
import org.codelibs.fess.es.cbean.FileAuthenticationCB;
import org.codelibs.fess.es.exentity.FileAuthentication;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsFileAuthenticationBhv extends AbstractBehavior<FileAuthentication, FileAuthenticationCB> {
@Override
public String asTableDbName() {
return "file_authentication";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public FileAuthenticationDbm asDBMeta() {
return FileAuthenticationDbm.getInstance();
}
@Override
protected <RESULT extends FileAuthentication> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setFileConfigId((String) source.get("fileConfigId"));
result.setHostname((String) source.get("hostname"));
result.setId((String) source.get("id"));
result.setParameters((String) source.get("parameters"));
result.setPassword((String) source.get("password"));
result.setPort((Integer) source.get("port"));
result.setProtocolScheme((String) source.get("protocolScheme"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
result.setUsername((String) source.get("username"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<FileAuthenticationCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<FileAuthentication> selectEntity(CBCall<FileAuthenticationCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<FileAuthentication> facadeSelectEntity(FileAuthenticationCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends FileAuthentication> OptionalEntity<ENTITY> doSelectOptionalEntity(FileAuthenticationCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public FileAuthenticationCB newConditionBean() {
return new FileAuthenticationCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public FileAuthentication selectEntityWithDeletedCheck(CBCall<FileAuthenticationCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<FileAuthentication> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<FileAuthentication> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends FileAuthentication> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected FileAuthenticationCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends FileAuthentication> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends FileAuthentication> typeOfSelectedEntity() {
return FileAuthentication.class;
}
@Override
protected Class<FileAuthentication> typeOfHandlingEntity() {
return FileAuthentication.class;
}
@Override
protected Class<FileAuthenticationCB> typeOfHandlingConditionBean() {
return FileAuthenticationCB.class;
}
public ListResultBean<FileAuthentication> selectList(CBCall<FileAuthenticationCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<FileAuthentication> selectPage(CBCall<FileAuthenticationCB> cbLambda) {
// TODO same?
return (PagingResultBean<FileAuthentication>) facadeSelectList(createCB(cbLambda));
}
public void insert(FileAuthentication entity) {
doInsert(entity, null);
}
public void insert(FileAuthentication entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(FileAuthentication entity) {
doUpdate(entity, null);
}
public void update(FileAuthentication entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(FileAuthentication entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(FileAuthentication entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(FileAuthentication entity) {
doDelete(entity, null);
}
public void delete(FileAuthentication entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,190 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.FileConfigDbm;
import org.codelibs.fess.es.cbean.FileConfigCB;
import org.codelibs.fess.es.exentity.FileConfig;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsFileConfigBhv extends AbstractBehavior<FileConfig, FileConfigCB> {
@Override
public String asTableDbName() {
return "file_config";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public FileConfigDbm asDBMeta() {
return FileConfigDbm.getInstance();
}
@Override
protected <RESULT extends FileConfig> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAvailable((Boolean) source.get("available"));
result.setBoost((Float) source.get("boost"));
result.setConfigParameter((String) source.get("configParameter"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setDepth((Integer) source.get("depth"));
result.setExcludedDocPaths((String) source.get("excludedDocPaths"));
result.setExcludedPaths((String) source.get("excludedPaths"));
result.setId((String) source.get("id"));
result.setIncludedDocPaths((String) source.get("includedDocPaths"));
result.setIncludedPaths((String) source.get("includedPaths"));
result.setIntervalTime((Integer) source.get("intervalTime"));
result.setMaxAccessCount((Long) source.get("maxAccessCount"));
result.setName((String) source.get("name"));
result.setNumOfThread((Integer) source.get("numOfThread"));
result.setPaths((String) source.get("paths"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<FileConfigCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<FileConfig> selectEntity(CBCall<FileConfigCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<FileConfig> facadeSelectEntity(FileConfigCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends FileConfig> OptionalEntity<ENTITY> doSelectOptionalEntity(FileConfigCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public FileConfigCB newConditionBean() {
return new FileConfigCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public FileConfig selectEntityWithDeletedCheck(CBCall<FileConfigCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<FileConfig> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<FileConfig> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends FileConfig> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected FileConfigCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends FileConfig> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends FileConfig> typeOfSelectedEntity() {
return FileConfig.class;
}
@Override
protected Class<FileConfig> typeOfHandlingEntity() {
return FileConfig.class;
}
@Override
protected Class<FileConfigCB> typeOfHandlingConditionBean() {
return FileConfigCB.class;
}
public ListResultBean<FileConfig> selectList(CBCall<FileConfigCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<FileConfig> selectPage(CBCall<FileConfigCB> cbLambda) {
// TODO same?
return (PagingResultBean<FileConfig>) facadeSelectList(createCB(cbLambda));
}
public void insert(FileConfig entity) {
doInsert(entity, null);
}
public void insert(FileConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(FileConfig entity) {
doUpdate(entity, null);
}
public void update(FileConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(FileConfig entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(FileConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(FileConfig entity) {
doDelete(entity, null);
}
public void delete(FileConfig entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.FileConfigToLabelDbm;
import org.codelibs.fess.es.cbean.FileConfigToLabelCB;
import org.codelibs.fess.es.exentity.FileConfigToLabel;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsFileConfigToLabelBhv extends AbstractBehavior<FileConfigToLabel, FileConfigToLabelCB> {
@Override
public String asTableDbName() {
return "file_config_to_label";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public FileConfigToLabelDbm asDBMeta() {
return FileConfigToLabelDbm.getInstance();
}
@Override
protected <RESULT extends FileConfigToLabel> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setFileConfigId((String) source.get("fileConfigId"));
result.setId((String) source.get("id"));
result.setLabelTypeId((String) source.get("labelTypeId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<FileConfigToLabelCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<FileConfigToLabel> selectEntity(CBCall<FileConfigToLabelCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<FileConfigToLabel> facadeSelectEntity(FileConfigToLabelCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends FileConfigToLabel> OptionalEntity<ENTITY> doSelectOptionalEntity(FileConfigToLabelCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public FileConfigToLabelCB newConditionBean() {
return new FileConfigToLabelCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public FileConfigToLabel selectEntityWithDeletedCheck(CBCall<FileConfigToLabelCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<FileConfigToLabel> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<FileConfigToLabel> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends FileConfigToLabel> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected FileConfigToLabelCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends FileConfigToLabel> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends FileConfigToLabel> typeOfSelectedEntity() {
return FileConfigToLabel.class;
}
@Override
protected Class<FileConfigToLabel> typeOfHandlingEntity() {
return FileConfigToLabel.class;
}
@Override
protected Class<FileConfigToLabelCB> typeOfHandlingConditionBean() {
return FileConfigToLabelCB.class;
}
public ListResultBean<FileConfigToLabel> selectList(CBCall<FileConfigToLabelCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<FileConfigToLabel> selectPage(CBCall<FileConfigToLabelCB> cbLambda) {
// TODO same?
return (PagingResultBean<FileConfigToLabel>) facadeSelectList(createCB(cbLambda));
}
public void insert(FileConfigToLabel entity) {
doInsert(entity, null);
}
public void insert(FileConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(FileConfigToLabel entity) {
doUpdate(entity, null);
}
public void update(FileConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(FileConfigToLabel entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(FileConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(FileConfigToLabel entity) {
doDelete(entity, null);
}
public void delete(FileConfigToLabel entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.FileConfigToRoleDbm;
import org.codelibs.fess.es.cbean.FileConfigToRoleCB;
import org.codelibs.fess.es.exentity.FileConfigToRole;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsFileConfigToRoleBhv extends AbstractBehavior<FileConfigToRole, FileConfigToRoleCB> {
@Override
public String asTableDbName() {
return "file_config_to_role";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public FileConfigToRoleDbm asDBMeta() {
return FileConfigToRoleDbm.getInstance();
}
@Override
protected <RESULT extends FileConfigToRole> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setFileConfigId((String) source.get("fileConfigId"));
result.setId((String) source.get("id"));
result.setRoleTypeId((String) source.get("roleTypeId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<FileConfigToRoleCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<FileConfigToRole> selectEntity(CBCall<FileConfigToRoleCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<FileConfigToRole> facadeSelectEntity(FileConfigToRoleCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends FileConfigToRole> OptionalEntity<ENTITY> doSelectOptionalEntity(FileConfigToRoleCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public FileConfigToRoleCB newConditionBean() {
return new FileConfigToRoleCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public FileConfigToRole selectEntityWithDeletedCheck(CBCall<FileConfigToRoleCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<FileConfigToRole> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<FileConfigToRole> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends FileConfigToRole> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected FileConfigToRoleCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends FileConfigToRole> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends FileConfigToRole> typeOfSelectedEntity() {
return FileConfigToRole.class;
}
@Override
protected Class<FileConfigToRole> typeOfHandlingEntity() {
return FileConfigToRole.class;
}
@Override
protected Class<FileConfigToRoleCB> typeOfHandlingConditionBean() {
return FileConfigToRoleCB.class;
}
public ListResultBean<FileConfigToRole> selectList(CBCall<FileConfigToRoleCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<FileConfigToRole> selectPage(CBCall<FileConfigToRoleCB> cbLambda) {
// TODO same?
return (PagingResultBean<FileConfigToRole>) facadeSelectList(createCB(cbLambda));
}
public void insert(FileConfigToRole entity) {
doInsert(entity, null);
}
public void insert(FileConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(FileConfigToRole entity) {
doUpdate(entity, null);
}
public void update(FileConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(FileConfigToRole entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(FileConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(FileConfigToRole entity) {
doDelete(entity, null);
}
public void delete(FileConfigToRole entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,180 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.JobLogDbm;
import org.codelibs.fess.es.cbean.JobLogCB;
import org.codelibs.fess.es.exentity.JobLog;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsJobLogBhv extends AbstractBehavior<JobLog, JobLogCB> {
@Override
public String asTableDbName() {
return "job_log";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public JobLogDbm asDBMeta() {
return JobLogDbm.getInstance();
}
@Override
protected <RESULT extends JobLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setEndTime((Long) source.get("endTime"));
result.setId((String) source.get("id"));
result.setJobName((String) source.get("jobName"));
result.setJobStatus((String) source.get("jobStatus"));
result.setScriptData((String) source.get("scriptData"));
result.setScriptResult((String) source.get("scriptResult"));
result.setScriptType((String) source.get("scriptType"));
result.setStartTime((Long) source.get("startTime"));
result.setTarget((String) source.get("target"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<JobLogCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<JobLog> selectEntity(CBCall<JobLogCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<JobLog> facadeSelectEntity(JobLogCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends JobLog> OptionalEntity<ENTITY> doSelectOptionalEntity(JobLogCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public JobLogCB newConditionBean() {
return new JobLogCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public JobLog selectEntityWithDeletedCheck(CBCall<JobLogCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<JobLog> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<JobLog> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends JobLog> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected JobLogCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends JobLog> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends JobLog> typeOfSelectedEntity() {
return JobLog.class;
}
@Override
protected Class<JobLog> typeOfHandlingEntity() {
return JobLog.class;
}
@Override
protected Class<JobLogCB> typeOfHandlingConditionBean() {
return JobLogCB.class;
}
public ListResultBean<JobLog> selectList(CBCall<JobLogCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<JobLog> selectPage(CBCall<JobLogCB> cbLambda) {
// TODO same?
return (PagingResultBean<JobLog>) facadeSelectList(createCB(cbLambda));
}
public void insert(JobLog entity) {
doInsert(entity, null);
}
public void insert(JobLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(JobLog entity) {
doUpdate(entity, null);
}
public void update(JobLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(JobLog entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(JobLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(JobLog entity) {
doDelete(entity, null);
}
public void delete(JobLog entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,180 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.KeyMatchDbm;
import org.codelibs.fess.es.cbean.KeyMatchCB;
import org.codelibs.fess.es.exentity.KeyMatch;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsKeyMatchBhv extends AbstractBehavior<KeyMatch, KeyMatchCB> {
@Override
public String asTableDbName() {
return "key_match";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public KeyMatchDbm asDBMeta() {
return KeyMatchDbm.getInstance();
}
@Override
protected <RESULT extends KeyMatch> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setBoost((Float) source.get("boost"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setMaxSize((Integer) source.get("maxSize"));
result.setQuery((String) source.get("query"));
result.setTerm((String) source.get("term"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<KeyMatchCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<KeyMatch> selectEntity(CBCall<KeyMatchCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<KeyMatch> facadeSelectEntity(KeyMatchCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends KeyMatch> OptionalEntity<ENTITY> doSelectOptionalEntity(KeyMatchCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public KeyMatchCB newConditionBean() {
return new KeyMatchCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public KeyMatch selectEntityWithDeletedCheck(CBCall<KeyMatchCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<KeyMatch> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<KeyMatch> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends KeyMatch> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected KeyMatchCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends KeyMatch> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends KeyMatch> typeOfSelectedEntity() {
return KeyMatch.class;
}
@Override
protected Class<KeyMatch> typeOfHandlingEntity() {
return KeyMatch.class;
}
@Override
protected Class<KeyMatchCB> typeOfHandlingConditionBean() {
return KeyMatchCB.class;
}
public ListResultBean<KeyMatch> selectList(CBCall<KeyMatchCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<KeyMatch> selectPage(CBCall<KeyMatchCB> cbLambda) {
// TODO same?
return (PagingResultBean<KeyMatch>) facadeSelectList(createCB(cbLambda));
}
public void insert(KeyMatch entity) {
doInsert(entity, null);
}
public void insert(KeyMatch entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(KeyMatch entity) {
doUpdate(entity, null);
}
public void update(KeyMatch entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(KeyMatch entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(KeyMatch entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(KeyMatch entity) {
doDelete(entity, null);
}
public void delete(KeyMatch entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,174 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.LabelToRoleDbm;
import org.codelibs.fess.es.cbean.LabelToRoleCB;
import org.codelibs.fess.es.exentity.LabelToRole;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsLabelToRoleBhv extends AbstractBehavior<LabelToRole, LabelToRoleCB> {
@Override
public String asTableDbName() {
return "label_to_role";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public LabelToRoleDbm asDBMeta() {
return LabelToRoleDbm.getInstance();
}
@Override
protected <RESULT extends LabelToRole> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setId((String) source.get("id"));
result.setLabelTypeId((String) source.get("labelTypeId"));
result.setRoleTypeId((String) source.get("roleTypeId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<LabelToRoleCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<LabelToRole> selectEntity(CBCall<LabelToRoleCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<LabelToRole> facadeSelectEntity(LabelToRoleCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends LabelToRole> OptionalEntity<ENTITY> doSelectOptionalEntity(LabelToRoleCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public LabelToRoleCB newConditionBean() {
return new LabelToRoleCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public LabelToRole selectEntityWithDeletedCheck(CBCall<LabelToRoleCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<LabelToRole> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<LabelToRole> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends LabelToRole> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected LabelToRoleCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends LabelToRole> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends LabelToRole> typeOfSelectedEntity() {
return LabelToRole.class;
}
@Override
protected Class<LabelToRole> typeOfHandlingEntity() {
return LabelToRole.class;
}
@Override
protected Class<LabelToRoleCB> typeOfHandlingConditionBean() {
return LabelToRoleCB.class;
}
public ListResultBean<LabelToRole> selectList(CBCall<LabelToRoleCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<LabelToRole> selectPage(CBCall<LabelToRoleCB> cbLambda) {
// TODO same?
return (PagingResultBean<LabelToRole>) facadeSelectList(createCB(cbLambda));
}
public void insert(LabelToRole entity) {
doInsert(entity, null);
}
public void insert(LabelToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(LabelToRole entity) {
doUpdate(entity, null);
}
public void update(LabelToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(LabelToRole entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(LabelToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(LabelToRole entity) {
doDelete(entity, null);
}
public void delete(LabelToRole entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,181 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.LabelTypeDbm;
import org.codelibs.fess.es.cbean.LabelTypeCB;
import org.codelibs.fess.es.exentity.LabelType;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsLabelTypeBhv extends AbstractBehavior<LabelType, LabelTypeCB> {
@Override
public String asTableDbName() {
return "label_type";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public LabelTypeDbm asDBMeta() {
return LabelTypeDbm.getInstance();
}
@Override
protected <RESULT extends LabelType> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setExcludedPaths((String) source.get("excludedPaths"));
result.setId((String) source.get("id"));
result.setIncludedPaths((String) source.get("includedPaths"));
result.setName((String) source.get("name"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
result.setValue((String) source.get("value"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<LabelTypeCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<LabelType> selectEntity(CBCall<LabelTypeCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<LabelType> facadeSelectEntity(LabelTypeCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends LabelType> OptionalEntity<ENTITY> doSelectOptionalEntity(LabelTypeCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public LabelTypeCB newConditionBean() {
return new LabelTypeCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public LabelType selectEntityWithDeletedCheck(CBCall<LabelTypeCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<LabelType> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<LabelType> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends LabelType> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected LabelTypeCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends LabelType> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends LabelType> typeOfSelectedEntity() {
return LabelType.class;
}
@Override
protected Class<LabelType> typeOfHandlingEntity() {
return LabelType.class;
}
@Override
protected Class<LabelTypeCB> typeOfHandlingConditionBean() {
return LabelTypeCB.class;
}
public ListResultBean<LabelType> selectList(CBCall<LabelTypeCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<LabelType> selectPage(CBCall<LabelTypeCB> cbLambda) {
// TODO same?
return (PagingResultBean<LabelType>) facadeSelectList(createCB(cbLambda));
}
public void insert(LabelType entity) {
doInsert(entity, null);
}
public void insert(LabelType entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(LabelType entity) {
doUpdate(entity, null);
}
public void update(LabelType entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(LabelType entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(LabelType entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(LabelType entity) {
doDelete(entity, null);
}
public void delete(LabelType entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,180 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.OverlappingHostDbm;
import org.codelibs.fess.es.cbean.OverlappingHostCB;
import org.codelibs.fess.es.exentity.OverlappingHost;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsOverlappingHostBhv extends AbstractBehavior<OverlappingHost, OverlappingHostCB> {
@Override
public String asTableDbName() {
return "overlapping_host";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public OverlappingHostDbm asDBMeta() {
return OverlappingHostDbm.getInstance();
}
@Override
protected <RESULT extends OverlappingHost> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setOverlappingName((String) source.get("overlappingName"));
result.setRegularName((String) source.get("regularName"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<OverlappingHostCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<OverlappingHost> selectEntity(CBCall<OverlappingHostCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<OverlappingHost> facadeSelectEntity(OverlappingHostCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends OverlappingHost> OptionalEntity<ENTITY> doSelectOptionalEntity(OverlappingHostCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public OverlappingHostCB newConditionBean() {
return new OverlappingHostCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public OverlappingHost selectEntityWithDeletedCheck(CBCall<OverlappingHostCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<OverlappingHost> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<OverlappingHost> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends OverlappingHost> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected OverlappingHostCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends OverlappingHost> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends OverlappingHost> typeOfSelectedEntity() {
return OverlappingHost.class;
}
@Override
protected Class<OverlappingHost> typeOfHandlingEntity() {
return OverlappingHost.class;
}
@Override
protected Class<OverlappingHostCB> typeOfHandlingConditionBean() {
return OverlappingHostCB.class;
}
public ListResultBean<OverlappingHost> selectList(CBCall<OverlappingHostCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<OverlappingHost> selectPage(CBCall<OverlappingHostCB> cbLambda) {
// TODO same?
return (PagingResultBean<OverlappingHost>) facadeSelectList(createCB(cbLambda));
}
public void insert(OverlappingHost entity) {
doInsert(entity, null);
}
public void insert(OverlappingHost entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(OverlappingHost entity) {
doUpdate(entity, null);
}
public void update(OverlappingHost entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(OverlappingHost entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(OverlappingHost entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(OverlappingHost entity) {
doDelete(entity, null);
}
public void delete(OverlappingHost entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,180 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.PathMappingDbm;
import org.codelibs.fess.es.cbean.PathMappingCB;
import org.codelibs.fess.es.exentity.PathMapping;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsPathMappingBhv extends AbstractBehavior<PathMapping, PathMappingCB> {
@Override
public String asTableDbName() {
return "path_mapping";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public PathMappingDbm asDBMeta() {
return PathMappingDbm.getInstance();
}
@Override
protected <RESULT extends PathMapping> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setProcessType((String) source.get("processType"));
result.setRegex((String) source.get("regex"));
result.setReplacement((String) source.get("replacement"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<PathMappingCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<PathMapping> selectEntity(CBCall<PathMappingCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<PathMapping> facadeSelectEntity(PathMappingCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends PathMapping> OptionalEntity<ENTITY> doSelectOptionalEntity(PathMappingCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public PathMappingCB newConditionBean() {
return new PathMappingCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public PathMapping selectEntityWithDeletedCheck(CBCall<PathMappingCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<PathMapping> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<PathMapping> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends PathMapping> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected PathMappingCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends PathMapping> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends PathMapping> typeOfSelectedEntity() {
return PathMapping.class;
}
@Override
protected Class<PathMapping> typeOfHandlingEntity() {
return PathMapping.class;
}
@Override
protected Class<PathMappingCB> typeOfHandlingConditionBean() {
return PathMappingCB.class;
}
public ListResultBean<PathMapping> selectList(CBCall<PathMappingCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<PathMapping> selectPage(CBCall<PathMappingCB> cbLambda) {
// TODO same?
return (PagingResultBean<PathMapping>) facadeSelectList(createCB(cbLambda));
}
public void insert(PathMapping entity) {
doInsert(entity, null);
}
public void insert(PathMapping entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(PathMapping entity) {
doUpdate(entity, null);
}
public void update(PathMapping entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(PathMapping entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(PathMapping entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(PathMapping entity) {
doDelete(entity, null);
}
public void delete(PathMapping entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,179 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.RequestHeaderDbm;
import org.codelibs.fess.es.cbean.RequestHeaderCB;
import org.codelibs.fess.es.exentity.RequestHeader;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsRequestHeaderBhv extends AbstractBehavior<RequestHeader, RequestHeaderCB> {
@Override
public String asTableDbName() {
return "request_header";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public RequestHeaderDbm asDBMeta() {
return RequestHeaderDbm.getInstance();
}
@Override
protected <RESULT extends RequestHeader> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setName((String) source.get("name"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
result.setValue((String) source.get("value"));
result.setWebConfigId((String) source.get("webConfigId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<RequestHeaderCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<RequestHeader> selectEntity(CBCall<RequestHeaderCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<RequestHeader> facadeSelectEntity(RequestHeaderCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends RequestHeader> OptionalEntity<ENTITY> doSelectOptionalEntity(RequestHeaderCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public RequestHeaderCB newConditionBean() {
return new RequestHeaderCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public RequestHeader selectEntityWithDeletedCheck(CBCall<RequestHeaderCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<RequestHeader> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<RequestHeader> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends RequestHeader> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected RequestHeaderCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends RequestHeader> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends RequestHeader> typeOfSelectedEntity() {
return RequestHeader.class;
}
@Override
protected Class<RequestHeader> typeOfHandlingEntity() {
return RequestHeader.class;
}
@Override
protected Class<RequestHeaderCB> typeOfHandlingConditionBean() {
return RequestHeaderCB.class;
}
public ListResultBean<RequestHeader> selectList(CBCall<RequestHeaderCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<RequestHeader> selectPage(CBCall<RequestHeaderCB> cbLambda) {
// TODO same?
return (PagingResultBean<RequestHeader>) facadeSelectList(createCB(cbLambda));
}
public void insert(RequestHeader entity) {
doInsert(entity, null);
}
public void insert(RequestHeader entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(RequestHeader entity) {
doUpdate(entity, null);
}
public void update(RequestHeader entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(RequestHeader entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(RequestHeader entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(RequestHeader entity) {
doDelete(entity, null);
}
public void delete(RequestHeader entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,179 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.RoleTypeDbm;
import org.codelibs.fess.es.cbean.RoleTypeCB;
import org.codelibs.fess.es.exentity.RoleType;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsRoleTypeBhv extends AbstractBehavior<RoleType, RoleTypeCB> {
@Override
public String asTableDbName() {
return "role_type";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public RoleTypeDbm asDBMeta() {
return RoleTypeDbm.getInstance();
}
@Override
protected <RESULT extends RoleType> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setName((String) source.get("name"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
result.setValue((String) source.get("value"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<RoleTypeCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<RoleType> selectEntity(CBCall<RoleTypeCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<RoleType> facadeSelectEntity(RoleTypeCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends RoleType> OptionalEntity<ENTITY> doSelectOptionalEntity(RoleTypeCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public RoleTypeCB newConditionBean() {
return new RoleTypeCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public RoleType selectEntityWithDeletedCheck(CBCall<RoleTypeCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<RoleType> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<RoleType> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends RoleType> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected RoleTypeCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends RoleType> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends RoleType> typeOfSelectedEntity() {
return RoleType.class;
}
@Override
protected Class<RoleType> typeOfHandlingEntity() {
return RoleType.class;
}
@Override
protected Class<RoleTypeCB> typeOfHandlingConditionBean() {
return RoleTypeCB.class;
}
public ListResultBean<RoleType> selectList(CBCall<RoleTypeCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<RoleType> selectPage(CBCall<RoleTypeCB> cbLambda) {
// TODO same?
return (PagingResultBean<RoleType>) facadeSelectList(createCB(cbLambda));
}
public void insert(RoleType entity) {
doInsert(entity, null);
}
public void insert(RoleType entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(RoleType entity) {
doUpdate(entity, null);
}
public void update(RoleType entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(RoleType entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(RoleType entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(RoleType entity) {
doDelete(entity, null);
}
public void delete(RoleType entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,185 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.ScheduledJobDbm;
import org.codelibs.fess.es.cbean.ScheduledJobCB;
import org.codelibs.fess.es.exentity.ScheduledJob;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsScheduledJobBhv extends AbstractBehavior<ScheduledJob, ScheduledJobCB> {
@Override
public String asTableDbName() {
return "scheduled_job";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public ScheduledJobDbm asDBMeta() {
return ScheduledJobDbm.getInstance();
}
@Override
protected <RESULT extends ScheduledJob> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAvailable((Boolean) source.get("available"));
result.setCrawler((String) source.get("crawler"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setCronExpression((String) source.get("cronExpression"));
result.setId((String) source.get("id"));
result.setJobLogging((Boolean) source.get("jobLogging"));
result.setName((String) source.get("name"));
result.setScriptData((String) source.get("scriptData"));
result.setScriptType((String) source.get("scriptType"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setTarget((String) source.get("target"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<ScheduledJobCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<ScheduledJob> selectEntity(CBCall<ScheduledJobCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<ScheduledJob> facadeSelectEntity(ScheduledJobCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends ScheduledJob> OptionalEntity<ENTITY> doSelectOptionalEntity(ScheduledJobCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public ScheduledJobCB newConditionBean() {
return new ScheduledJobCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public ScheduledJob selectEntityWithDeletedCheck(CBCall<ScheduledJobCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<ScheduledJob> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<ScheduledJob> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends ScheduledJob> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected ScheduledJobCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends ScheduledJob> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends ScheduledJob> typeOfSelectedEntity() {
return ScheduledJob.class;
}
@Override
protected Class<ScheduledJob> typeOfHandlingEntity() {
return ScheduledJob.class;
}
@Override
protected Class<ScheduledJobCB> typeOfHandlingConditionBean() {
return ScheduledJobCB.class;
}
public ListResultBean<ScheduledJob> selectList(CBCall<ScheduledJobCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<ScheduledJob> selectPage(CBCall<ScheduledJobCB> cbLambda) {
// TODO same?
return (PagingResultBean<ScheduledJob>) facadeSelectList(createCB(cbLambda));
}
public void insert(ScheduledJob entity) {
doInsert(entity, null);
}
public void insert(ScheduledJob entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(ScheduledJob entity) {
doUpdate(entity, null);
}
public void update(ScheduledJob entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(ScheduledJob entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(ScheduledJob entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(ScheduledJob entity) {
doDelete(entity, null);
}
public void delete(ScheduledJob entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.SearchFieldLogDbm;
import org.codelibs.fess.es.cbean.SearchFieldLogCB;
import org.codelibs.fess.es.exentity.SearchFieldLog;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsSearchFieldLogBhv extends AbstractBehavior<SearchFieldLog, SearchFieldLogCB> {
@Override
public String asTableDbName() {
return "search_field_log";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public SearchFieldLogDbm asDBMeta() {
return SearchFieldLogDbm.getInstance();
}
@Override
protected <RESULT extends SearchFieldLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setId((String) source.get("id"));
result.setName((String) source.get("name"));
result.setSearchLogId((String) source.get("searchLogId"));
result.setValue((String) source.get("value"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<SearchFieldLog> selectEntity(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<SearchFieldLog> facadeSelectEntity(SearchFieldLogCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends SearchFieldLog> OptionalEntity<ENTITY> doSelectOptionalEntity(SearchFieldLogCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public SearchFieldLogCB newConditionBean() {
return new SearchFieldLogCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public SearchFieldLog selectEntityWithDeletedCheck(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<SearchFieldLog> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<SearchFieldLog> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends SearchFieldLog> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected SearchFieldLogCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends SearchFieldLog> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends SearchFieldLog> typeOfSelectedEntity() {
return SearchFieldLog.class;
}
@Override
protected Class<SearchFieldLog> typeOfHandlingEntity() {
return SearchFieldLog.class;
}
@Override
protected Class<SearchFieldLogCB> typeOfHandlingConditionBean() {
return SearchFieldLogCB.class;
}
public ListResultBean<SearchFieldLog> selectList(CBCall<SearchFieldLogCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<SearchFieldLog> selectPage(CBCall<SearchFieldLogCB> cbLambda) {
// TODO same?
return (PagingResultBean<SearchFieldLog>) facadeSelectList(createCB(cbLambda));
}
public void insert(SearchFieldLog entity) {
doInsert(entity, null);
}
public void insert(SearchFieldLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(SearchFieldLog entity) {
doUpdate(entity, null);
}
public void update(SearchFieldLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(SearchFieldLog entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(SearchFieldLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(SearchFieldLog entity) {
doDelete(entity, null);
}
public void delete(SearchFieldLog entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,184 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.SearchLogDbm;
import org.codelibs.fess.es.cbean.SearchLogCB;
import org.codelibs.fess.es.exentity.SearchLog;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsSearchLogBhv extends AbstractBehavior<SearchLog, SearchLogCB> {
@Override
public String asTableDbName() {
return "search_log";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public SearchLogDbm asDBMeta() {
return SearchLogDbm.getInstance();
}
@Override
protected <RESULT extends SearchLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAccessType((String) source.get("accessType"));
result.setClientIp((String) source.get("clientIp"));
result.setHitCount((Long) source.get("hitCount"));
result.setId((String) source.get("id"));
result.setQueryOffset((Integer) source.get("queryOffset"));
result.setQueryPageSize((Integer) source.get("queryPageSize"));
result.setReferer((String) source.get("referer"));
result.setRequestedTime((Long) source.get("requestedTime"));
result.setResponseTime((Integer) source.get("responseTime"));
result.setSearchWord((String) source.get("searchWord"));
result.setUserAgent((String) source.get("userAgent"));
result.setUserId((Long) source.get("userId"));
result.setUserSessionId((String) source.get("userSessionId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<SearchLogCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<SearchLog> selectEntity(CBCall<SearchLogCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<SearchLog> facadeSelectEntity(SearchLogCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends SearchLog> OptionalEntity<ENTITY> doSelectOptionalEntity(SearchLogCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public SearchLogCB newConditionBean() {
return new SearchLogCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public SearchLog selectEntityWithDeletedCheck(CBCall<SearchLogCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<SearchLog> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<SearchLog> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends SearchLog> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected SearchLogCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends SearchLog> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends SearchLog> typeOfSelectedEntity() {
return SearchLog.class;
}
@Override
protected Class<SearchLog> typeOfHandlingEntity() {
return SearchLog.class;
}
@Override
protected Class<SearchLogCB> typeOfHandlingConditionBean() {
return SearchLogCB.class;
}
public ListResultBean<SearchLog> selectList(CBCall<SearchLogCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<SearchLog> selectPage(CBCall<SearchLogCB> cbLambda) {
// TODO same?
return (PagingResultBean<SearchLog>) facadeSelectList(createCB(cbLambda));
}
public void insert(SearchLog entity) {
doInsert(entity, null);
}
public void insert(SearchLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(SearchLog entity) {
doUpdate(entity, null);
}
public void update(SearchLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(SearchLog entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(SearchLog entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(SearchLog entity) {
doDelete(entity, null);
}
public void delete(SearchLog entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,179 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.SuggestBadWordDbm;
import org.codelibs.fess.es.cbean.SuggestBadWordCB;
import org.codelibs.fess.es.exentity.SuggestBadWord;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsSuggestBadWordBhv extends AbstractBehavior<SuggestBadWord, SuggestBadWordCB> {
@Override
public String asTableDbName() {
return "suggest_bad_word";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public SuggestBadWordDbm asDBMeta() {
return SuggestBadWordDbm.getInstance();
}
@Override
protected <RESULT extends SuggestBadWord> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setSuggestWord((String) source.get("suggestWord"));
result.setTargetLabel((String) source.get("targetLabel"));
result.setTargetRole((String) source.get("targetRole"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<SuggestBadWordCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<SuggestBadWord> selectEntity(CBCall<SuggestBadWordCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<SuggestBadWord> facadeSelectEntity(SuggestBadWordCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends SuggestBadWord> OptionalEntity<ENTITY> doSelectOptionalEntity(SuggestBadWordCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public SuggestBadWordCB newConditionBean() {
return new SuggestBadWordCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public SuggestBadWord selectEntityWithDeletedCheck(CBCall<SuggestBadWordCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<SuggestBadWord> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<SuggestBadWord> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends SuggestBadWord> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected SuggestBadWordCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends SuggestBadWord> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends SuggestBadWord> typeOfSelectedEntity() {
return SuggestBadWord.class;
}
@Override
protected Class<SuggestBadWord> typeOfHandlingEntity() {
return SuggestBadWord.class;
}
@Override
protected Class<SuggestBadWordCB> typeOfHandlingConditionBean() {
return SuggestBadWordCB.class;
}
public ListResultBean<SuggestBadWord> selectList(CBCall<SuggestBadWordCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<SuggestBadWord> selectPage(CBCall<SuggestBadWordCB> cbLambda) {
// TODO same?
return (PagingResultBean<SuggestBadWord>) facadeSelectList(createCB(cbLambda));
}
public void insert(SuggestBadWord entity) {
doInsert(entity, null);
}
public void insert(SuggestBadWord entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(SuggestBadWord entity) {
doUpdate(entity, null);
}
public void update(SuggestBadWord entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(SuggestBadWord entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(SuggestBadWord entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(SuggestBadWord entity) {
doDelete(entity, null);
}
public void delete(SuggestBadWord entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,182 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.SuggestElevateWordDbm;
import org.codelibs.fess.es.cbean.SuggestElevateWordCB;
import org.codelibs.fess.es.exentity.SuggestElevateWord;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsSuggestElevateWordBhv extends AbstractBehavior<SuggestElevateWord, SuggestElevateWordCB> {
@Override
public String asTableDbName() {
return "suggest_elevate_word";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public SuggestElevateWordDbm asDBMeta() {
return SuggestElevateWordDbm.getInstance();
}
@Override
protected <RESULT extends SuggestElevateWord> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setBoost((Float) source.get("boost"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setReading((String) source.get("reading"));
result.setSuggestWord((String) source.get("suggestWord"));
result.setTargetLabel((String) source.get("targetLabel"));
result.setTargetRole((String) source.get("targetRole"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<SuggestElevateWordCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<SuggestElevateWord> selectEntity(CBCall<SuggestElevateWordCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<SuggestElevateWord> facadeSelectEntity(SuggestElevateWordCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends SuggestElevateWord> OptionalEntity<ENTITY> doSelectOptionalEntity(SuggestElevateWordCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public SuggestElevateWordCB newConditionBean() {
return new SuggestElevateWordCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public SuggestElevateWord selectEntityWithDeletedCheck(CBCall<SuggestElevateWordCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<SuggestElevateWord> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<SuggestElevateWord> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends SuggestElevateWord> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected SuggestElevateWordCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends SuggestElevateWord> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends SuggestElevateWord> typeOfSelectedEntity() {
return SuggestElevateWord.class;
}
@Override
protected Class<SuggestElevateWord> typeOfHandlingEntity() {
return SuggestElevateWord.class;
}
@Override
protected Class<SuggestElevateWordCB> typeOfHandlingConditionBean() {
return SuggestElevateWordCB.class;
}
public ListResultBean<SuggestElevateWord> selectList(CBCall<SuggestElevateWordCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<SuggestElevateWord> selectPage(CBCall<SuggestElevateWordCB> cbLambda) {
// TODO same?
return (PagingResultBean<SuggestElevateWord>) facadeSelectList(createCB(cbLambda));
}
public void insert(SuggestElevateWord entity) {
doInsert(entity, null);
}
public void insert(SuggestElevateWord entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(SuggestElevateWord entity) {
doUpdate(entity, null);
}
public void update(SuggestElevateWord entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(SuggestElevateWord entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(SuggestElevateWord entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(SuggestElevateWord entity) {
doDelete(entity, null);
}
public void delete(SuggestElevateWord entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.UserInfoDbm;
import org.codelibs.fess.es.cbean.UserInfoCB;
import org.codelibs.fess.es.exentity.UserInfo;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsUserInfoBhv extends AbstractBehavior<UserInfo, UserInfoCB> {
@Override
public String asTableDbName() {
return "user_info";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public UserInfoDbm asDBMeta() {
return UserInfoDbm.getInstance();
}
@Override
protected <RESULT extends UserInfo> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCode((String) source.get("code"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setId((String) source.get("id"));
result.setUpdatedTime((Long) source.get("updatedTime"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<UserInfoCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<UserInfo> selectEntity(CBCall<UserInfoCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<UserInfo> facadeSelectEntity(UserInfoCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends UserInfo> OptionalEntity<ENTITY> doSelectOptionalEntity(UserInfoCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public UserInfoCB newConditionBean() {
return new UserInfoCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public UserInfo selectEntityWithDeletedCheck(CBCall<UserInfoCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<UserInfo> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<UserInfo> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends UserInfo> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected UserInfoCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends UserInfo> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends UserInfo> typeOfSelectedEntity() {
return UserInfo.class;
}
@Override
protected Class<UserInfo> typeOfHandlingEntity() {
return UserInfo.class;
}
@Override
protected Class<UserInfoCB> typeOfHandlingConditionBean() {
return UserInfoCB.class;
}
public ListResultBean<UserInfo> selectList(CBCall<UserInfoCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<UserInfo> selectPage(CBCall<UserInfoCB> cbLambda) {
// TODO same?
return (PagingResultBean<UserInfo>) facadeSelectList(createCB(cbLambda));
}
public void insert(UserInfo entity) {
doInsert(entity, null);
}
public void insert(UserInfo entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(UserInfo entity) {
doUpdate(entity, null);
}
public void update(UserInfo entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(UserInfo entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(UserInfo entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(UserInfo entity) {
doDelete(entity, null);
}
public void delete(UserInfo entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,185 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.WebAuthenticationDbm;
import org.codelibs.fess.es.cbean.WebAuthenticationCB;
import org.codelibs.fess.es.exentity.WebAuthentication;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsWebAuthenticationBhv extends AbstractBehavior<WebAuthentication, WebAuthenticationCB> {
@Override
public String asTableDbName() {
return "web_authentication";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public WebAuthenticationDbm asDBMeta() {
return WebAuthenticationDbm.getInstance();
}
@Override
protected <RESULT extends WebAuthentication> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAuthRealm((String) source.get("authRealm"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setHostname((String) source.get("hostname"));
result.setId((String) source.get("id"));
result.setParameters((String) source.get("parameters"));
result.setPassword((String) source.get("password"));
result.setPort((Integer) source.get("port"));
result.setProtocolScheme((String) source.get("protocolScheme"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
result.setUsername((String) source.get("username"));
result.setWebConfigId((String) source.get("webConfigId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<WebAuthenticationCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<WebAuthentication> selectEntity(CBCall<WebAuthenticationCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<WebAuthentication> facadeSelectEntity(WebAuthenticationCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends WebAuthentication> OptionalEntity<ENTITY> doSelectOptionalEntity(WebAuthenticationCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public WebAuthenticationCB newConditionBean() {
return new WebAuthenticationCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public WebAuthentication selectEntityWithDeletedCheck(CBCall<WebAuthenticationCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<WebAuthentication> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<WebAuthentication> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends WebAuthentication> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected WebAuthenticationCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends WebAuthentication> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends WebAuthentication> typeOfSelectedEntity() {
return WebAuthentication.class;
}
@Override
protected Class<WebAuthentication> typeOfHandlingEntity() {
return WebAuthentication.class;
}
@Override
protected Class<WebAuthenticationCB> typeOfHandlingConditionBean() {
return WebAuthenticationCB.class;
}
public ListResultBean<WebAuthentication> selectList(CBCall<WebAuthenticationCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<WebAuthentication> selectPage(CBCall<WebAuthenticationCB> cbLambda) {
// TODO same?
return (PagingResultBean<WebAuthentication>) facadeSelectList(createCB(cbLambda));
}
public void insert(WebAuthentication entity) {
doInsert(entity, null);
}
public void insert(WebAuthentication entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(WebAuthentication entity) {
doUpdate(entity, null);
}
public void update(WebAuthentication entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(WebAuthentication entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(WebAuthentication entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(WebAuthentication entity) {
doDelete(entity, null);
}
public void delete(WebAuthentication entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,191 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.WebConfigDbm;
import org.codelibs.fess.es.cbean.WebConfigCB;
import org.codelibs.fess.es.exentity.WebConfig;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsWebConfigBhv extends AbstractBehavior<WebConfig, WebConfigCB> {
@Override
public String asTableDbName() {
return "web_config";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public WebConfigDbm asDBMeta() {
return WebConfigDbm.getInstance();
}
@Override
protected <RESULT extends WebConfig> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAvailable((Boolean) source.get("available"));
result.setBoost((Float) source.get("boost"));
result.setConfigParameter((String) source.get("configParameter"));
result.setCreatedBy((String) source.get("createdBy"));
result.setCreatedTime((Long) source.get("createdTime"));
result.setDepth((Integer) source.get("depth"));
result.setExcludedDocUrls((String) source.get("excludedDocUrls"));
result.setExcludedUrls((String) source.get("excludedUrls"));
result.setId((String) source.get("id"));
result.setIncludedDocUrls((String) source.get("includedDocUrls"));
result.setIncludedUrls((String) source.get("includedUrls"));
result.setIntervalTime((Integer) source.get("intervalTime"));
result.setMaxAccessCount((Long) source.get("maxAccessCount"));
result.setName((String) source.get("name"));
result.setNumOfThread((Integer) source.get("numOfThread"));
result.setSortOrder((Integer) source.get("sortOrder"));
result.setUpdatedBy((String) source.get("updatedBy"));
result.setUpdatedTime((Long) source.get("updatedTime"));
result.setUrls((String) source.get("urls"));
result.setUserAgent((String) source.get("userAgent"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<WebConfigCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<WebConfig> selectEntity(CBCall<WebConfigCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<WebConfig> facadeSelectEntity(WebConfigCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends WebConfig> OptionalEntity<ENTITY> doSelectOptionalEntity(WebConfigCB cb, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public WebConfigCB newConditionBean() {
return new WebConfigCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public WebConfig selectEntityWithDeletedCheck(CBCall<WebConfigCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<WebConfig> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<WebConfig> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends WebConfig> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected WebConfigCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends WebConfig> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends WebConfig> typeOfSelectedEntity() {
return WebConfig.class;
}
@Override
protected Class<WebConfig> typeOfHandlingEntity() {
return WebConfig.class;
}
@Override
protected Class<WebConfigCB> typeOfHandlingConditionBean() {
return WebConfigCB.class;
}
public ListResultBean<WebConfig> selectList(CBCall<WebConfigCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<WebConfig> selectPage(CBCall<WebConfigCB> cbLambda) {
// TODO same?
return (PagingResultBean<WebConfig>) facadeSelectList(createCB(cbLambda));
}
public void insert(WebConfig entity) {
doInsert(entity, null);
}
public void insert(WebConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(WebConfig entity) {
doUpdate(entity, null);
}
public void update(WebConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(WebConfig entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(WebConfig entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(WebConfig entity) {
doDelete(entity, null);
}
public void delete(WebConfig entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.WebConfigToLabelDbm;
import org.codelibs.fess.es.cbean.WebConfigToLabelCB;
import org.codelibs.fess.es.exentity.WebConfigToLabel;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsWebConfigToLabelBhv extends AbstractBehavior<WebConfigToLabel, WebConfigToLabelCB> {
@Override
public String asTableDbName() {
return "web_config_to_label";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public WebConfigToLabelDbm asDBMeta() {
return WebConfigToLabelDbm.getInstance();
}
@Override
protected <RESULT extends WebConfigToLabel> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setId((String) source.get("id"));
result.setLabelTypeId((String) source.get("labelTypeId"));
result.setWebConfigId((String) source.get("webConfigId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<WebConfigToLabelCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<WebConfigToLabel> selectEntity(CBCall<WebConfigToLabelCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<WebConfigToLabel> facadeSelectEntity(WebConfigToLabelCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends WebConfigToLabel> OptionalEntity<ENTITY> doSelectOptionalEntity(WebConfigToLabelCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public WebConfigToLabelCB newConditionBean() {
return new WebConfigToLabelCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public WebConfigToLabel selectEntityWithDeletedCheck(CBCall<WebConfigToLabelCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<WebConfigToLabel> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<WebConfigToLabel> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends WebConfigToLabel> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected WebConfigToLabelCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends WebConfigToLabel> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends WebConfigToLabel> typeOfSelectedEntity() {
return WebConfigToLabel.class;
}
@Override
protected Class<WebConfigToLabel> typeOfHandlingEntity() {
return WebConfigToLabel.class;
}
@Override
protected Class<WebConfigToLabelCB> typeOfHandlingConditionBean() {
return WebConfigToLabelCB.class;
}
public ListResultBean<WebConfigToLabel> selectList(CBCall<WebConfigToLabelCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<WebConfigToLabel> selectPage(CBCall<WebConfigToLabelCB> cbLambda) {
// TODO same?
return (PagingResultBean<WebConfigToLabel>) facadeSelectList(createCB(cbLambda));
}
public void insert(WebConfigToLabel entity) {
doInsert(entity, null);
}
public void insert(WebConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(WebConfigToLabel entity) {
doUpdate(entity, null);
}
public void update(WebConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(WebConfigToLabel entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(WebConfigToLabel entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(WebConfigToLabel entity) {
doDelete(entity, null);
}
public void delete(WebConfigToLabel entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,175 @@
package org.codelibs.fess.es.bsbhv;
import java.util.Map;
import org.codelibs.fess.es.bsentity.AbstractEntity;
import org.codelibs.fess.es.bsentity.AbstractEntity.RequestOptionCall;
import org.codelibs.fess.es.bsentity.dbmeta.WebConfigToRoleDbm;
import org.codelibs.fess.es.cbean.WebConfigToRoleCB;
import org.codelibs.fess.es.exentity.WebConfigToRole;
import org.dbflute.Entity;
import org.dbflute.bhv.readable.CBCall;
import org.dbflute.cbean.ConditionBean;
import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.cbean.result.PagingResultBean;
import org.dbflute.exception.IllegalBehaviorStateException;
import org.dbflute.optional.OptionalEntity;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class BsWebConfigToRoleBhv extends AbstractBehavior<WebConfigToRole, WebConfigToRoleCB> {
@Override
public String asTableDbName() {
return "web_config_to_role";
}
@Override
protected String asIndexEsName() {
return ".fess_config";
}
@Override
public WebConfigToRoleDbm asDBMeta() {
return WebConfigToRoleDbm.getInstance();
}
@Override
protected <RESULT extends WebConfigToRole> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setId((String) source.get("id"));
result.setRoleTypeId((String) source.get("roleTypeId"));
result.setWebConfigId((String) source.get("webConfigId"));
return result;
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
public int selectCount(CBCall<WebConfigToRoleCB> cbLambda) {
return facadeSelectCount(createCB(cbLambda));
}
public OptionalEntity<WebConfigToRole> selectEntity(CBCall<WebConfigToRoleCB> cbLambda) {
return facadeSelectEntity(createCB(cbLambda));
}
protected OptionalEntity<WebConfigToRole> facadeSelectEntity(WebConfigToRoleCB cb) {
return doSelectOptionalEntity(cb, typeOfSelectedEntity());
}
protected <ENTITY extends WebConfigToRole> OptionalEntity<ENTITY> doSelectOptionalEntity(WebConfigToRoleCB cb,
Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectEntity(cb, tp), cb);
}
@Override
public WebConfigToRoleCB newConditionBean() {
return new WebConfigToRoleCB();
}
@Override
protected Entity doReadEntity(ConditionBean cb) {
return facadeSelectEntity(downcast(cb)).orElse(null);
}
public WebConfigToRole selectEntityWithDeletedCheck(CBCall<WebConfigToRoleCB> cbLambda) {
return facadeSelectEntityWithDeletedCheck(createCB(cbLambda));
}
public OptionalEntity<WebConfigToRole> selectByPK(String id) {
return facadeSelectByPK(id);
}
protected OptionalEntity<WebConfigToRole> facadeSelectByPK(String id) {
return doSelectOptionalByPK(id, typeOfSelectedEntity());
}
protected <ENTITY extends WebConfigToRole> ENTITY doSelectByPK(String id, Class<? extends ENTITY> tp) {
return doSelectEntity(xprepareCBAsPK(id), tp);
}
protected WebConfigToRoleCB xprepareCBAsPK(String id) {
assertObjectNotNull("id", id);
return newConditionBean().acceptPK(id);
}
protected <ENTITY extends WebConfigToRole> OptionalEntity<ENTITY> doSelectOptionalByPK(String id, Class<? extends ENTITY> tp) {
return createOptionalEntity(doSelectByPK(id, tp), id);
}
@Override
protected Class<? extends WebConfigToRole> typeOfSelectedEntity() {
return WebConfigToRole.class;
}
@Override
protected Class<WebConfigToRole> typeOfHandlingEntity() {
return WebConfigToRole.class;
}
@Override
protected Class<WebConfigToRoleCB> typeOfHandlingConditionBean() {
return WebConfigToRoleCB.class;
}
public ListResultBean<WebConfigToRole> selectList(CBCall<WebConfigToRoleCB> cbLambda) {
return facadeSelectList(createCB(cbLambda));
}
public PagingResultBean<WebConfigToRole> selectPage(CBCall<WebConfigToRoleCB> cbLambda) {
// TODO same?
return (PagingResultBean<WebConfigToRole>) facadeSelectList(createCB(cbLambda));
}
public void insert(WebConfigToRole entity) {
doInsert(entity, null);
}
public void insert(WebConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsert(entity, null);
}
public void update(WebConfigToRole entity) {
doUpdate(entity, null);
}
public void update(WebConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doUpdate(entity, null);
}
public void insertOrUpdate(WebConfigToRole entity) {
doInsertOrUpdate(entity, null, null);
}
public void insertOrUpdate(WebConfigToRole entity, RequestOptionCall<IndexRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().indexOption(opLambda);
}
doInsertOrUpdate(entity, null, null);
}
public void delete(WebConfigToRole entity) {
doDelete(entity, null);
}
public void delete(WebConfigToRole entity, RequestOptionCall<DeleteRequestBuilder> opLambda) {
if (entity instanceof AbstractEntity) {
entity.asDocMeta().deleteOption(opLambda);
}
doDelete(entity, null);
}
// TODO create, modify, remove
}

View file

@ -0,0 +1,220 @@
package org.codelibs.fess.es.bsentity;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import org.dbflute.Entity;
import org.dbflute.FunCustodial;
import org.dbflute.dbmeta.accessory.EntityModifiedProperties;
import org.dbflute.dbmeta.accessory.EntityUniqueDrivenProperties;
import org.dbflute.util.DfCollectionUtil;
import org.elasticsearch.action.delete.DeleteRequestBuilder;
import org.elasticsearch.action.index.IndexRequestBuilder;
/**
* @author FreeGen
*/
public abstract class AbstractEntity implements Entity, Serializable, Cloneable {
private static final long serialVersionUID = 1L;
protected DocMeta docMeta;
protected final EntityUniqueDrivenProperties __uniqueDrivenProperties = newUniqueDrivenProperties();
protected final EntityModifiedProperties __modifiedProperties = newModifiedProperties();
protected EntityModifiedProperties __specifiedProperties;
public DocMeta asDocMeta() {
if (docMeta == null) {
docMeta = new DocMeta();
}
return docMeta;
}
public Set<String> mymodifiedProperties() {
return __modifiedProperties.getPropertyNames();
}
public void mymodifyProperty(String propertyName) {
registerModifiedProperty(propertyName);
}
public void mymodifyPropertyCancel(String propertyName) {
__modifiedProperties.remove(propertyName);
}
public void clearModifiedInfo() {
__modifiedProperties.clear();
}
public boolean hasModification() {
return !__modifiedProperties.isEmpty();
}
protected EntityModifiedProperties newModifiedProperties() {
return new EntityModifiedProperties();
}
protected void registerModifiedProperty(String propertyName) {
__modifiedProperties.addPropertyName(propertyName);
registerSpecifiedProperty(propertyName); // synchronize if exists, basically for user's manual call
}
public void modifiedToSpecified() {
if (__modifiedProperties.isEmpty()) {
return; // basically no way when called in Framework (because called when SpecifyColumn exists)
}
__specifiedProperties = newModifiedProperties();
__specifiedProperties.accept(__modifiedProperties);
}
public Set<String> myspecifiedProperties() {
if (__specifiedProperties != null) {
return __specifiedProperties.getPropertyNames();
}
return DfCollectionUtil.emptySet();
}
public void myspecifyProperty(String propertyName) {
registerSpecifiedProperty(propertyName);
}
public void myspecifyPropertyCancel(String propertyName) {
if (__specifiedProperties != null) {
__specifiedProperties.remove(propertyName);
}
}
public void clearSpecifiedInfo() {
if (__specifiedProperties != null) {
__specifiedProperties.clear();
}
}
protected void checkSpecifiedProperty(String propertyName) {
FunCustodial.checkSpecifiedProperty(this, propertyName, __specifiedProperties);
}
protected void registerSpecifiedProperty(String propertyName) { // basically called by modified property registration
if (__specifiedProperties != null) { // normally false, true if e.g. setting after selected
__specifiedProperties.addPropertyName(propertyName);
}
}
@Override
public boolean hasPrimaryKeyValue() {
return asDocMeta().id() != null;
}
protected EntityUniqueDrivenProperties newUniqueDrivenProperties() {
return new EntityUniqueDrivenProperties();
}
@Override
public Set<String> myuniqueDrivenProperties() {
return __uniqueDrivenProperties.getPropertyNames();
}
@Override
public void myuniqueByProperty(String propertyName) {
__uniqueDrivenProperties.addPropertyName(propertyName);
}
@Override
public void myuniqueByPropertyCancel(String propertyName) {
__uniqueDrivenProperties.remove(propertyName);
}
@Override
public void clearUniqueDrivenInfo() {
__uniqueDrivenProperties.clear();
}
@Override
public void markAsSelect() {
// TODO Auto-generated method stub
}
@Override
public boolean createdBySelect() {
// TODO Auto-generated method stub
return false;
}
@Override
public int instanceHash() {
// TODO Auto-generated method stub
return 0;
}
@Override
public String toStringWithRelation() {
// TODO Auto-generated method stub
return null;
}
@Override
public String buildDisplayString(String name, boolean column, boolean relation) {
// TODO Auto-generated method stub
return null;
}
public abstract Map<String, Object> toSource();
public class DocMeta {
protected String id;
protected Long version;
private RequestOptionCall<IndexRequestBuilder> indexOption;
private RequestOptionCall<DeleteRequestBuilder> deleteOption;
public DocMeta id(String id) {
this.id = id;
myuniqueByProperty("_id");
return this;
}
public String id() {
return id;
}
public DocMeta version(Long version) {
this.version = version;
return this;
}
public Long version() {
return version;
}
public DocMeta indexOption(RequestOptionCall<IndexRequestBuilder> builder) {
this.indexOption = builder;
return this;
}
public RequestOptionCall<IndexRequestBuilder> indexOption() {
return indexOption;
}
public DocMeta deleteOption(RequestOptionCall<DeleteRequestBuilder> builder) {
this.deleteOption = builder;
return this;
}
public RequestOptionCall<DeleteRequestBuilder> deleteOption() {
return deleteOption;
}
}
@FunctionalInterface
public interface RequestOptionCall<OP> {
void callback(OP op);
}
}

View file

@ -0,0 +1,151 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.BoostDocumentRuleDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsBoostDocumentRule extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public BoostDocumentRuleDbm asDBMeta() {
return BoostDocumentRuleDbm.getInstance();
}
@Override
public String asTableDbName() {
return "boost_document_rule";
}
// ===================================================================================
// Attribute
// =========
/** boostExpr */
protected String boostExpr;
/** createdBy */
protected String createdBy;
/** createdTime */
protected Long createdTime;
/** id */
protected String id;
/** sortOrder */
protected Integer sortOrder;
/** updatedBy */
protected String updatedBy;
/** updatedTime */
protected Long updatedTime;
/** urlExpr */
protected String urlExpr;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getBoostExpr() {
return boostExpr;
}
public void setBoostExpr(String value) {
boostExpr = value;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String value) {
createdBy = value;
}
public Long getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Long value) {
createdTime = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public Integer getSortOrder() {
return sortOrder;
}
public void setSortOrder(Integer value) {
sortOrder = value;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String value) {
updatedBy = value;
}
public Long getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Long value) {
updatedTime = value;
}
public String getUrlExpr() {
return urlExpr;
}
public void setUrlExpr(String value) {
urlExpr = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (boostExpr != null) {
sourceMap.put("boostExpr", boostExpr);
}
if (createdBy != null) {
sourceMap.put("createdBy", createdBy);
}
if (createdTime != null) {
sourceMap.put("createdTime", createdTime);
}
if (id != null) {
sourceMap.put("id", id);
}
if (sortOrder != null) {
sourceMap.put("sortOrder", sortOrder);
}
if (updatedBy != null) {
sourceMap.put("updatedBy", updatedBy);
}
if (updatedTime != null) {
sourceMap.put("updatedTime", updatedTime);
}
if (urlExpr != null) {
sourceMap.put("urlExpr", urlExpr);
}
return sourceMap;
}
}

View file

@ -0,0 +1,95 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.ClickLogDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsClickLog extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public ClickLogDbm asDBMeta() {
return ClickLogDbm.getInstance();
}
@Override
public String asTableDbName() {
return "click_log";
}
// ===================================================================================
// Attribute
// =========
/** id */
protected String id;
/** requestedTime */
protected Long requestedTime;
/** searchLogId */
protected String searchLogId;
/** url */
protected String url;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public Long getRequestedTime() {
return requestedTime;
}
public void setRequestedTime(Long value) {
requestedTime = value;
}
public String getSearchLogId() {
return searchLogId;
}
public void setSearchLogId(String value) {
searchLogId = value;
}
public String getUrl() {
return url;
}
public void setUrl(String value) {
url = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (id != null) {
sourceMap.put("id", id);
}
if (requestedTime != null) {
sourceMap.put("requestedTime", requestedTime);
}
if (searchLogId != null) {
sourceMap.put("searchLogId", searchLogId);
}
if (url != null) {
sourceMap.put("url", url);
}
return sourceMap;
}
}

View file

@ -0,0 +1,109 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.CrawlingSessionDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsCrawlingSession extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public CrawlingSessionDbm asDBMeta() {
return CrawlingSessionDbm.getInstance();
}
@Override
public String asTableDbName() {
return "crawling_session";
}
// ===================================================================================
// Attribute
// =========
/** createdTime */
protected Long createdTime;
/** expiredTime */
protected Long expiredTime;
/** id */
protected String id;
/** name */
protected String name;
/** sessionId */
protected String sessionId;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public Long getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Long value) {
createdTime = value;
}
public Long getExpiredTime() {
return expiredTime;
}
public void setExpiredTime(Long value) {
expiredTime = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getName() {
return name;
}
public void setName(String value) {
name = value;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String value) {
sessionId = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (createdTime != null) {
sourceMap.put("createdTime", createdTime);
}
if (expiredTime != null) {
sourceMap.put("expiredTime", expiredTime);
}
if (id != null) {
sourceMap.put("id", id);
}
if (name != null) {
sourceMap.put("name", name);
}
if (sessionId != null) {
sourceMap.put("sessionId", sessionId);
}
return sourceMap;
}
}

View file

@ -0,0 +1,109 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.CrawlingSessionInfoDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsCrawlingSessionInfo extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public CrawlingSessionInfoDbm asDBMeta() {
return CrawlingSessionInfoDbm.getInstance();
}
@Override
public String asTableDbName() {
return "crawling_session_info";
}
// ===================================================================================
// Attribute
// =========
/** crawlingSessionId */
protected String crawlingSessionId;
/** createdTime */
protected Long createdTime;
/** id */
protected String id;
/** key */
protected String key;
/** value */
protected String value;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getCrawlingSessionId() {
return crawlingSessionId;
}
public void setCrawlingSessionId(String value) {
crawlingSessionId = value;
}
public Long getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Long value) {
createdTime = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getKey() {
return key;
}
public void setKey(String value) {
key = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
value = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (crawlingSessionId != null) {
sourceMap.put("crawlingSessionId", crawlingSessionId);
}
if (createdTime != null) {
sourceMap.put("createdTime", createdTime);
}
if (id != null) {
sourceMap.put("id", id);
}
if (key != null) {
sourceMap.put("key", key);
}
if (value != null) {
sourceMap.put("value", value);
}
return sourceMap;
}
}

View file

@ -0,0 +1,207 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.DataConfigDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsDataConfig extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public DataConfigDbm asDBMeta() {
return DataConfigDbm.getInstance();
}
@Override
public String asTableDbName() {
return "data_config";
}
// ===================================================================================
// Attribute
// =========
/** available */
protected Boolean available;
/** boost */
protected Float boost;
/** createdBy */
protected String createdBy;
/** createdTime */
protected Long createdTime;
/** handlerName */
protected String handlerName;
/** handlerParameter */
protected String handlerParameter;
/** handlerScript */
protected String handlerScript;
/** id */
protected String id;
/** name */
protected String name;
/** sortOrder */
protected Integer sortOrder;
/** updatedBy */
protected String updatedBy;
/** updatedTime */
protected Long updatedTime;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public Boolean getAvailable() {
return available;
}
public void setAvailable(Boolean value) {
available = value;
}
public Float getBoost() {
return boost;
}
public void setBoost(Float value) {
boost = value;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String value) {
createdBy = value;
}
public Long getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Long value) {
createdTime = value;
}
public String getHandlerName() {
return handlerName;
}
public void setHandlerName(String value) {
handlerName = value;
}
public String getHandlerParameter() {
return handlerParameter;
}
public void setHandlerParameter(String value) {
handlerParameter = value;
}
public String getHandlerScript() {
return handlerScript;
}
public void setHandlerScript(String value) {
handlerScript = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getName() {
return name;
}
public void setName(String value) {
name = value;
}
public Integer getSortOrder() {
return sortOrder;
}
public void setSortOrder(Integer value) {
sortOrder = value;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String value) {
updatedBy = value;
}
public Long getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Long value) {
updatedTime = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (available != null) {
sourceMap.put("available", available);
}
if (boost != null) {
sourceMap.put("boost", boost);
}
if (createdBy != null) {
sourceMap.put("createdBy", createdBy);
}
if (createdTime != null) {
sourceMap.put("createdTime", createdTime);
}
if (handlerName != null) {
sourceMap.put("handlerName", handlerName);
}
if (handlerParameter != null) {
sourceMap.put("handlerParameter", handlerParameter);
}
if (handlerScript != null) {
sourceMap.put("handlerScript", handlerScript);
}
if (id != null) {
sourceMap.put("id", id);
}
if (name != null) {
sourceMap.put("name", name);
}
if (sortOrder != null) {
sourceMap.put("sortOrder", sortOrder);
}
if (updatedBy != null) {
sourceMap.put("updatedBy", updatedBy);
}
if (updatedTime != null) {
sourceMap.put("updatedTime", updatedTime);
}
return sourceMap;
}
}

View file

@ -0,0 +1,81 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.DataConfigToLabelDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsDataConfigToLabel extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public DataConfigToLabelDbm asDBMeta() {
return DataConfigToLabelDbm.getInstance();
}
@Override
public String asTableDbName() {
return "data_config_to_label";
}
// ===================================================================================
// Attribute
// =========
/** dataConfigId */
protected String dataConfigId;
/** id */
protected String id;
/** labelTypeId */
protected String labelTypeId;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getDataConfigId() {
return dataConfigId;
}
public void setDataConfigId(String value) {
dataConfigId = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getLabelTypeId() {
return labelTypeId;
}
public void setLabelTypeId(String value) {
labelTypeId = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (dataConfigId != null) {
sourceMap.put("dataConfigId", dataConfigId);
}
if (id != null) {
sourceMap.put("id", id);
}
if (labelTypeId != null) {
sourceMap.put("labelTypeId", labelTypeId);
}
return sourceMap;
}
}

View file

@ -0,0 +1,81 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.DataConfigToRoleDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsDataConfigToRole extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public DataConfigToRoleDbm asDBMeta() {
return DataConfigToRoleDbm.getInstance();
}
@Override
public String asTableDbName() {
return "data_config_to_role";
}
// ===================================================================================
// Attribute
// =========
/** dataConfigId */
protected String dataConfigId;
/** id */
protected String id;
/** roleTypeId */
protected String roleTypeId;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getDataConfigId() {
return dataConfigId;
}
public void setDataConfigId(String value) {
dataConfigId = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getRoleTypeId() {
return roleTypeId;
}
public void setRoleTypeId(String value) {
roleTypeId = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (dataConfigId != null) {
sourceMap.put("dataConfigId", dataConfigId);
}
if (id != null) {
sourceMap.put("id", id);
}
if (roleTypeId != null) {
sourceMap.put("roleTypeId", roleTypeId);
}
return sourceMap;
}
}

View file

@ -0,0 +1,151 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.FailureUrlDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsFailureUrl extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public FailureUrlDbm asDBMeta() {
return FailureUrlDbm.getInstance();
}
@Override
public String asTableDbName() {
return "failure_url";
}
// ===================================================================================
// Attribute
// =========
/** configId */
protected String configId;
/** errorCount */
protected Integer errorCount;
/** errorLog */
protected String errorLog;
/** errorName */
protected String errorName;
/** id */
protected String id;
/** lastAccessTime */
protected Long lastAccessTime;
/** threadName */
protected String threadName;
/** url */
protected String url;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getConfigId() {
return configId;
}
public void setConfigId(String value) {
configId = value;
}
public Integer getErrorCount() {
return errorCount;
}
public void setErrorCount(Integer value) {
errorCount = value;
}
public String getErrorLog() {
return errorLog;
}
public void setErrorLog(String value) {
errorLog = value;
}
public String getErrorName() {
return errorName;
}
public void setErrorName(String value) {
errorName = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public Long getLastAccessTime() {
return lastAccessTime;
}
public void setLastAccessTime(Long value) {
lastAccessTime = value;
}
public String getThreadName() {
return threadName;
}
public void setThreadName(String value) {
threadName = value;
}
public String getUrl() {
return url;
}
public void setUrl(String value) {
url = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (configId != null) {
sourceMap.put("configId", configId);
}
if (errorCount != null) {
sourceMap.put("errorCount", errorCount);
}
if (errorLog != null) {
sourceMap.put("errorLog", errorLog);
}
if (errorName != null) {
sourceMap.put("errorName", errorName);
}
if (id != null) {
sourceMap.put("id", id);
}
if (lastAccessTime != null) {
sourceMap.put("lastAccessTime", lastAccessTime);
}
if (threadName != null) {
sourceMap.put("threadName", threadName);
}
if (url != null) {
sourceMap.put("url", url);
}
return sourceMap;
}
}

View file

@ -0,0 +1,95 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.FavoriteLogDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsFavoriteLog extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public FavoriteLogDbm asDBMeta() {
return FavoriteLogDbm.getInstance();
}
@Override
public String asTableDbName() {
return "favorite_log";
}
// ===================================================================================
// Attribute
// =========
/** createdTime */
protected Long createdTime;
/** id */
protected String id;
/** url */
protected String url;
/** userInfoId */
protected String userInfoId;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public Long getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Long value) {
createdTime = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getUrl() {
return url;
}
public void setUrl(String value) {
url = value;
}
public String getUserInfoId() {
return userInfoId;
}
public void setUserInfoId(String value) {
userInfoId = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (createdTime != null) {
sourceMap.put("createdTime", createdTime);
}
if (id != null) {
sourceMap.put("id", id);
}
if (url != null) {
sourceMap.put("url", url);
}
if (userInfoId != null) {
sourceMap.put("userInfoId", userInfoId);
}
return sourceMap;
}
}

View file

@ -0,0 +1,207 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.FileAuthenticationDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsFileAuthentication extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public FileAuthenticationDbm asDBMeta() {
return FileAuthenticationDbm.getInstance();
}
@Override
public String asTableDbName() {
return "file_authentication";
}
// ===================================================================================
// Attribute
// =========
/** createdBy */
protected String createdBy;
/** createdTime */
protected Long createdTime;
/** fileConfigId */
protected String fileConfigId;
/** hostname */
protected String hostname;
/** id */
protected String id;
/** parameters */
protected String parameters;
/** password */
protected String password;
/** port */
protected Integer port;
/** protocolScheme */
protected String protocolScheme;
/** updatedBy */
protected String updatedBy;
/** updatedTime */
protected Long updatedTime;
/** username */
protected String username;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String value) {
createdBy = value;
}
public Long getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Long value) {
createdTime = value;
}
public String getFileConfigId() {
return fileConfigId;
}
public void setFileConfigId(String value) {
fileConfigId = value;
}
public String getHostname() {
return hostname;
}
public void setHostname(String value) {
hostname = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getParameters() {
return parameters;
}
public void setParameters(String value) {
parameters = value;
}
public String getPassword() {
return password;
}
public void setPassword(String value) {
password = value;
}
public Integer getPort() {
return port;
}
public void setPort(Integer value) {
port = value;
}
public String getProtocolScheme() {
return protocolScheme;
}
public void setProtocolScheme(String value) {
protocolScheme = value;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String value) {
updatedBy = value;
}
public Long getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Long value) {
updatedTime = value;
}
public String getUsername() {
return username;
}
public void setUsername(String value) {
username = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (createdBy != null) {
sourceMap.put("createdBy", createdBy);
}
if (createdTime != null) {
sourceMap.put("createdTime", createdTime);
}
if (fileConfigId != null) {
sourceMap.put("fileConfigId", fileConfigId);
}
if (hostname != null) {
sourceMap.put("hostname", hostname);
}
if (id != null) {
sourceMap.put("id", id);
}
if (parameters != null) {
sourceMap.put("parameters", parameters);
}
if (password != null) {
sourceMap.put("password", password);
}
if (port != null) {
sourceMap.put("port", port);
}
if (protocolScheme != null) {
sourceMap.put("protocolScheme", protocolScheme);
}
if (updatedBy != null) {
sourceMap.put("updatedBy", updatedBy);
}
if (updatedTime != null) {
sourceMap.put("updatedTime", updatedTime);
}
if (username != null) {
sourceMap.put("username", username);
}
return sourceMap;
}
}

View file

@ -0,0 +1,305 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.FileConfigDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsFileConfig extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public FileConfigDbm asDBMeta() {
return FileConfigDbm.getInstance();
}
@Override
public String asTableDbName() {
return "file_config";
}
// ===================================================================================
// Attribute
// =========
/** available */
protected Boolean available;
/** boost */
protected Float boost;
/** configParameter */
protected String configParameter;
/** createdBy */
protected String createdBy;
/** createdTime */
protected Long createdTime;
/** depth */
protected Integer depth;
/** excludedDocPaths */
protected String excludedDocPaths;
/** excludedPaths */
protected String excludedPaths;
/** id */
protected String id;
/** includedDocPaths */
protected String includedDocPaths;
/** includedPaths */
protected String includedPaths;
/** intervalTime */
protected Integer intervalTime;
/** maxAccessCount */
protected Long maxAccessCount;
/** name */
protected String name;
/** numOfThread */
protected Integer numOfThread;
/** paths */
protected String paths;
/** sortOrder */
protected Integer sortOrder;
/** updatedBy */
protected String updatedBy;
/** updatedTime */
protected Long updatedTime;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public Boolean getAvailable() {
return available;
}
public void setAvailable(Boolean value) {
available = value;
}
public Float getBoost() {
return boost;
}
public void setBoost(Float value) {
boost = value;
}
public String getConfigParameter() {
return configParameter;
}
public void setConfigParameter(String value) {
configParameter = value;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String value) {
createdBy = value;
}
public Long getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Long value) {
createdTime = value;
}
public Integer getDepth() {
return depth;
}
public void setDepth(Integer value) {
depth = value;
}
public String getExcludedDocPaths() {
return excludedDocPaths;
}
public void setExcludedDocPaths(String value) {
excludedDocPaths = value;
}
public String getExcludedPaths() {
return excludedPaths;
}
public void setExcludedPaths(String value) {
excludedPaths = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getIncludedDocPaths() {
return includedDocPaths;
}
public void setIncludedDocPaths(String value) {
includedDocPaths = value;
}
public String getIncludedPaths() {
return includedPaths;
}
public void setIncludedPaths(String value) {
includedPaths = value;
}
public Integer getIntervalTime() {
return intervalTime;
}
public void setIntervalTime(Integer value) {
intervalTime = value;
}
public Long getMaxAccessCount() {
return maxAccessCount;
}
public void setMaxAccessCount(Long value) {
maxAccessCount = value;
}
public String getName() {
return name;
}
public void setName(String value) {
name = value;
}
public Integer getNumOfThread() {
return numOfThread;
}
public void setNumOfThread(Integer value) {
numOfThread = value;
}
public String getPaths() {
return paths;
}
public void setPaths(String value) {
paths = value;
}
public Integer getSortOrder() {
return sortOrder;
}
public void setSortOrder(Integer value) {
sortOrder = value;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String value) {
updatedBy = value;
}
public Long getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Long value) {
updatedTime = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (available != null) {
sourceMap.put("available", available);
}
if (boost != null) {
sourceMap.put("boost", boost);
}
if (configParameter != null) {
sourceMap.put("configParameter", configParameter);
}
if (createdBy != null) {
sourceMap.put("createdBy", createdBy);
}
if (createdTime != null) {
sourceMap.put("createdTime", createdTime);
}
if (depth != null) {
sourceMap.put("depth", depth);
}
if (excludedDocPaths != null) {
sourceMap.put("excludedDocPaths", excludedDocPaths);
}
if (excludedPaths != null) {
sourceMap.put("excludedPaths", excludedPaths);
}
if (id != null) {
sourceMap.put("id", id);
}
if (includedDocPaths != null) {
sourceMap.put("includedDocPaths", includedDocPaths);
}
if (includedPaths != null) {
sourceMap.put("includedPaths", includedPaths);
}
if (intervalTime != null) {
sourceMap.put("intervalTime", intervalTime);
}
if (maxAccessCount != null) {
sourceMap.put("maxAccessCount", maxAccessCount);
}
if (name != null) {
sourceMap.put("name", name);
}
if (numOfThread != null) {
sourceMap.put("numOfThread", numOfThread);
}
if (paths != null) {
sourceMap.put("paths", paths);
}
if (sortOrder != null) {
sourceMap.put("sortOrder", sortOrder);
}
if (updatedBy != null) {
sourceMap.put("updatedBy", updatedBy);
}
if (updatedTime != null) {
sourceMap.put("updatedTime", updatedTime);
}
return sourceMap;
}
}

View file

@ -0,0 +1,81 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.FileConfigToLabelDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsFileConfigToLabel extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public FileConfigToLabelDbm asDBMeta() {
return FileConfigToLabelDbm.getInstance();
}
@Override
public String asTableDbName() {
return "file_config_to_label";
}
// ===================================================================================
// Attribute
// =========
/** fileConfigId */
protected String fileConfigId;
/** id */
protected String id;
/** labelTypeId */
protected String labelTypeId;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getFileConfigId() {
return fileConfigId;
}
public void setFileConfigId(String value) {
fileConfigId = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getLabelTypeId() {
return labelTypeId;
}
public void setLabelTypeId(String value) {
labelTypeId = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (fileConfigId != null) {
sourceMap.put("fileConfigId", fileConfigId);
}
if (id != null) {
sourceMap.put("id", id);
}
if (labelTypeId != null) {
sourceMap.put("labelTypeId", labelTypeId);
}
return sourceMap;
}
}

View file

@ -0,0 +1,81 @@
package org.codelibs.fess.es.bsentity;
import java.util.HashMap;
import java.util.Map;
import org.codelibs.fess.es.bsentity.dbmeta.FileConfigToRoleDbm;
/**
* ${table.comment}
* @author FreeGen
*/
public class BsFileConfigToRole extends AbstractEntity {
private static final long serialVersionUID = 1L;
@Override
public FileConfigToRoleDbm asDBMeta() {
return FileConfigToRoleDbm.getInstance();
}
@Override
public String asTableDbName() {
return "file_config_to_role";
}
// ===================================================================================
// Attribute
// =========
/** fileConfigId */
protected String fileConfigId;
/** id */
protected String id;
/** roleTypeId */
protected String roleTypeId;
// [Referrers] *comment only
// ===================================================================================
// Accessor
// ========
public String getFileConfigId() {
return fileConfigId;
}
public void setFileConfigId(String value) {
fileConfigId = value;
}
public String getId() {
return id;
}
public void setId(String value) {
id = value;
}
public String getRoleTypeId() {
return roleTypeId;
}
public void setRoleTypeId(String value) {
roleTypeId = value;
}
@Override
public Map<String, Object> toSource() {
Map<String, Object> sourceMap = new HashMap<>();
if (fileConfigId != null) {
sourceMap.put("fileConfigId", fileConfigId);
}
if (id != null) {
sourceMap.put("id", id);
}
if (roleTypeId != null) {
sourceMap.put("roleTypeId", roleTypeId);
}
return sourceMap;
}
}

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