使用Telosys以Velocity模板语言浏览目录

时间:2019-03-27 12:49:26

标签: java json vtl telosys

我试图用VTL编写模板以使用telosys生成Java类。我的出发点是一个包含json文件(mapping1.json,mapping2.json等)的目录(src / main / resources / templates / es)。 json文件的数量和名称未知,可能会有所不同。我必须为每个json文件生成几个Java类。

我已经为我必须生成的每个Java类编写了一个模板。但是这些模板可与静态嵌入式json对象一起使用。

这个例子:

#set($json = {  
   "template":"acces_formation",
   "mappings":{  
      "data":{  
         "properties":{  
            "MATRICULE":{  
               "type":"string",
               "index":"not_analyzed"
            },
            "NOM":{  
               "type":"string",
               "index":"not_analyzed"
            },
            "DATE_NAIS":{  
               "type":"date",
               "format":"dd/MM/yyyy"
            },
            "SEXE":{  
               "type":"string",
               "index":"not_analyzed"
            },
            "GRADE":{  
               "type":"string",
               "index":"not_analyzed"
            }
         }
      }
   }
})
#macro(javaName $s)$s.substring(0,1).toUpperCase()$s.substring(1)#end
#macro(setter $s)set#javaName($s)#end
#macro(getter $s)get#javaName($s)#end
###############################start macro toCamelCase
#macro(toCamelCase $s)
#set($datas = $s.split("_"))
#set($name = "")
#foreach($data in $datas)
#set($data = $data.substring(0,1).toUpperCase()+$data.substring(1))
#set($name = $name+$data)
#end
$name##
#end
###############################End macro toCamelCase
###############################Start macro tab
#macro(tab $nbreTotal)
#if($nbreTotal >= 1)
#foreach($nbre in [1..$nbreTotal])
##
#end
#end
#end
###############################End macro tab
###############################Start macro javaType
#macro(javaType $f, $nbreTab)
#if($f.equals("string"))
#tab($nbreTab)String##
#elseif($f.equals("boolean"))
#tab($nbreTab)Boolean##
#elseif($f.equals("long"))
#tab($nbreTab)Long##
#elseif($f.equals("float"))
#tab($nbreTab)Float##
#elseif($f.equals("double"))
#tab($nbreTab)Double##
#elseif($f.equals("int"))
#tab($nbreTab)Integer##
#elseif($f.equals("integer"))
#tab($nbreTab)Integer##
#elseif($f.equals("date"))
#tab($nbreTab)String##
#elseif($f.equals("array"))
#tab($nbreTab)java.util.List<#javaType($f)>##
#else
#tab($nbreTab)$f##
#end
#end
###############################End macro javaType
#############################################

#set($templateName = $json.template)
#set($entity = "#toCamelCase($json.template)")
#set($entityDto = $entity+"Dto")
#set($param = "_param")

/*

Java dto for elasticSearch template $templateName
Created on $today.date ( Time $today.time )
Generator tool : $generator.name ( version $generator.version )
*/
package ${target.javaPackageFromFolder(${SRC})};

import java.util.Date;
import ${ROOT_PKG}.helper.contract.SearchParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**

DTO for elasticSearch template "$templateName"
@author Lazare yao
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder(alphabetic = true)
@getter
@Setter
@NoArgsConstructor
@tostring

public class $entityDto implements Cloneable {
#set($properties = $json.mappings.data.properties)
    private String#tab(3)_id;

#foreach($key in $properties.keySet())
#set($field = $key.toLowerCase())
#tab(1)private #javaType($properties.get($key).type,0)#tab(3)$field ;
#end

    private SearchParam<String>#tab(3)_id$param;
#foreach($key in $properties.keySet())
#set($field = $key.toLowerCase())
#tab(1)private SearchParam<#javaType($properties.get($key).type,0)>#tab(3)${field}$param;
#end

    private String orderDirection;
    private String orderField;
}

我现在需要的是:

1-浏览我的json目录,获取每个json文件,然后在该json上应用模板,以创建该json文件的java类。

2-正确配置文件 templates.cfg 以创建具有Java类名称的Java类文件。关于这一点,我尝试自模板以来修改变量 $ {BEANNAME},$ {BEANNAME_UC},$ {BEANNAME_LC} (telosys默认提供)。但是它不起作用:它们仍然为空,并且没有文件生成。这是文件 templates.cfg 的内容:

#---------------------------------------------------------
# Templates configuration file
# Values separated by ";"
# . value 1 : the label
# . value 2 : the file to be generated ( var allowed : ${BEANNAME}, ${BEANNAME_UC}, ${BEANNAME_LC} )
# . value 3 : the project folder where to generate ( var allowed : ${BEANNAME}, ${BEANNAME_UC}, ${BEANNAME_LC} )
# . value 4 : the template to use
# . value 5 : number of execution : "1" for "ONCE" for all entities, default is multiple executions ( executed for each entity )
#---------------------------------------------------------
# Since v 2.0 the project's variables can be used in file and folder name
#---------------------------------------------------------


Dto                ; ${BEANNAME}Dto.java                  ; ${SRC}/${ROOT_PKG}/helper/dto                       ; dto.vm

CustomDto          ; _${BEANNAME}Dto.java                 ; ${SRC}/${ROOT_PKG}/helper/dto/customize             ; _dto.vm

Enum               ; ${BEANNAME}Enum.java                 ; ${SRC}/${ROOT_PKG}/helper/enums                     ; enum.vm

Repository         ; ${BEANNAME}Repository.java           ; ${SRC}/${ROOT_PKG}/dao/repository/es                ; repository.vm         ;

Custom Repository  ; _${BEANNAME}Repository.java          ; ${SRC}/${ROOT_PKG}/dao/repository/es/customize      ; _repository.vm        ;

Business           ; ${BEANNAME}Business.java             ; ${SRC}/${ROOT_PKG}/business/                        ; business.vm

Controller         ; ${BEANNAME}Controller.java           ; ${SRC}/${ROOT_PKG}/rest/api                         ; controller.vm


谢谢您的帮助!

2 个答案:

答案 0 :(得分:1)

如果我理解正确,您想用一组JSON文件替换Telosys实体模型,是吗?

我认为有可能,但我们将不得不转移Telosys的行为……

首先,如果没有模型就无法启动Telosys代码生成,因此您必须创建一个 void DSL模型,例如使用以下命令的DSL模型“ void-model.model” 单个“假实体” (例如,只有“ id”属性的“假”实体)

第二,“ templates.cfg ”文件适用于模型中定义的所有实体,在您的情况下,没有实体,只有JSON文件。对于“ templates.cfg”文件的每一行,必须指定基数为“ 1” ,以便每个模板执行一次,而与实体数无关。

您只需在最后一个“;”之后添加“ 1”。每行,例如:

 Dto  ; Dto.txt  ; log ; dto.vm ; 1

在此步骤中,可以启动在“ templates.cfg”中定义的每个模板一次。

现在的想法是迭代每个模板中的所有JSON文件,并为每个JSON文件执行一个“子模板”。该“子模板”是将完成实际工作的模板。

要浏览目录,必须创建一个特定的Java类,该类将提供JSON文件列表。然后, $ generator 对象可用于为每个JSON文件执行一个“子模板”。

主模板示例:

## This template generates only a log file (see templates.cfg)

## Create instance of the specific class 
#set($dir = $loader.newInstance('mypackage.MyClass'))

## Use specific class instance to get all the JSON files
#set($jsonFiles = $dir.getJSONFiles() )

#foreach($json in $jsonFiles)
## Printed in log file
Processing $json
#set( $fileName   = "${json}-file.txt")
#set( $folder     = 'dest' )
## Execute the sub-template 'dto_sub.vm'
$generator.generate('Fake',  $fileName , $folder, "dto_sub.vm" )

#end

在子模板(例如“ dto_sub.vm”)中,使用$ target.file标识目标,从而标识所需的JSON文件

并使用另一个特定的类来加载JSON文件内容,并仅使用它来生成代码。

请参阅文档:

特定的Java类:http://www.telosys.org/templates-doc/objects/loader.html

子模板生成:http://www.telosys.org/templates-doc/objects/generator.html

答案 1 :(得分:0)

感谢您的帮助。 我做了@lgu上面向我解释的内容,并且效果很好。但是在这个版本中,我无法选择要生成Java类的json文件。我也不能选择我要应用的模板文件。这两个问题使我想到了使用其他方式执行我想要的其他版本:我考虑过利用dbrep文件。因此,在第二版中,我使用Java的DOM生成dbrep文件(这是一个xml文件)。我跟随this tutorial用json文件元素填充dbrep xml标记。每个json文件都成为<table>元素中的<tableList>元素。并且json文件属性成为<column>元素中的<table>元素。最终的dbrep文件如下所示:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
    <tableList databaseId="1" databaseName="test" databaseProductName="MySQL" generation="2019-04-18 16:52:19">
        <table catalog="bd_om_analytics" databaseType="TABLE" javaBean="AirtimeTrendHorarire" name="airtime_trend_horarire" schema="trend_horaire_airtime">
            <column dbComment="ElasticSearch zone_commerciale field" dbDefaultValue="" dbName="zone_commerciale" dbNotNull="false" dbPosition="1" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="zoneCommerciale" javaType="java.lang.String" jdbcTypeCode="12" label="zone commerciale" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch tete_de_pont field" dbDefaultValue="" dbName="tete_de_pont" dbNotNull="false" dbPosition="2" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="teteDePont" javaType="java.lang.String" jdbcTypeCode="12" label="tete de pont" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch trend_horaire field" dbDefaultValue="" dbName="trend_horaire" dbNotNull="false" dbPosition="3" dbPrimaryKey="false" dbSize="22" dbTypeName="DOUBLE" inputType="number" javaName="trendHoraire" javaType="java.lang.Double" jdbcTypeCode="8" label="trend horaire" notNull="false" selected="true"/>
            <column dateType="DT" dbComment="ElasticSearch date_jour field" dbDefaultValue="" dbName="date_jour" dbNotNull="false" dbPosition="4" dbPrimaryKey="false" dbSize="19" dbTypeName="DATETIME" inputType="" javaName="dateJour" javaType="java.util.Date" jdbcTypeCode="93" label="date jour" notNull="false" selected="true"/>
            <column dateType="DT" dbComment="ElasticSearch date_alerte field" dbDefaultValue="" dbName="date_alerte" dbNotNull="false" dbPosition="5" dbPrimaryKey="false" dbSize="19" dbTypeName="DATETIME" inputType="" javaName="dateAlerte" javaType="java.util.Date" jdbcTypeCode="93" label="date alerte" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch heure field" dbDefaultValue="" dbName="heure" dbNotNull="false" dbPosition="6" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="heure" javaType="java.lang.String" jdbcTypeCode="12" label="heure" maxLength="65000" notNull="false" selected="true"/>
            <column dbAutoIncremented="true" dbComment="" dbDefaultValue="" dbName="id" dbNotNull="true" dbPosition="7" dbPrimaryKey="true" dbSize="10" dbTypeName="INT" inputType="number" javaName="id" javaType="java.lang.Integer" jdbcTypeCode="4" label="Id" notNull="true" selected="true"/>
            <column dbComment="ElasticSearch source _id" dbDefaultValue="" dbName="_id" dbNotNull="false" dbPosition="8" dbPrimaryKey="false" dbSize="255" dbTypeName="VARCHAR" inputType="text" javaName="_id" javaType="java.lang.String" jdbcTypeCode="12" label="Id" maxLength="255" notNull="true" selected="true"/>
        </table>
        <table catalog="bd_om_analytics" databaseType="TABLE" javaBean="OmerDetailPdvSolde" name="omer_detail_pdv_solde" schema="airtime_detail_pdv_*">
            <column dbComment="ElasticSearch zone_commerciale field" dbDefaultValue="" dbName="zone_commerciale" dbNotNull="false" dbPosition="1" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="zoneCommerciale" javaType="java.lang.String" jdbcTypeCode="12" label="zone commerciale" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMMERCIAL field" dbDefaultValue="" dbName="COMMERCIAL" dbNotNull="false" dbPosition="2" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMMERCIAL" javaType="java.lang.String" jdbcTypeCode="12" label="COMMERCIAL" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch PDV field" dbDefaultValue="" dbName="PDV" dbNotNull="false" dbPosition="3" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="pDV" javaType="java.lang.String" jdbcTypeCode="12" label="PDV" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch RUPTURE field" dbDefaultValue="" dbName="RUPTURE" dbNotNull="false" dbPosition="4" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="rUPTURE" javaType="java.lang.String" jdbcTypeCode="12" label="RUPTURE" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch Canal field" dbDefaultValue="" dbName="Canal" dbNotNull="false" dbPosition="5" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="canal" javaType="java.lang.String" jdbcTypeCode="12" label="Canal" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch BALANCE field" dbDefaultValue="" dbName="BALANCE" dbNotNull="false" dbPosition="6" dbPrimaryKey="false" dbSize="20" dbTypeName="BIGINT" inputType="number" javaName="bALANCE" javaType="java.lang.Long" jdbcTypeCode="java.lang.Long" label="BALANCE" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch SEUIL field" dbDefaultValue="" dbName="SEUIL" dbNotNull="false" dbPosition="7" dbPrimaryKey="false" dbSize="20" dbTypeName="BIGINT" inputType="number" javaName="sEUIL" javaType="java.lang.Long" jdbcTypeCode="java.lang.Long" label="SEUIL" notNull="false" selected="true"/>
            <column dateType="DT" dbComment="ElasticSearch date_id field" dbDefaultValue="" dbName="date_id" dbNotNull="false" dbPosition="8" dbPrimaryKey="false" dbSize="19" dbTypeName="DATETIME" inputType="" javaName="dateId" javaType="java.util.Date" jdbcTypeCode="93" label="date id" notNull="false" selected="true"/>
            <column dateType="DT" dbComment="ElasticSearch date_jour field" dbDefaultValue="" dbName="date_jour" dbNotNull="false" dbPosition="9" dbPrimaryKey="false" dbSize="19" dbTypeName="DATETIME" inputType="" javaName="dateJour" javaType="java.util.Date" jdbcTypeCode="93" label="date jour" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch heure field" dbDefaultValue="" dbName="heure" dbNotNull="false" dbPosition="10" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="heure" javaType="java.lang.String" jdbcTypeCode="12" label="heure" maxLength="65000" notNull="false" selected="true"/>
            <column dbAutoIncremented="true" dbComment="" dbDefaultValue="" dbName="id" dbNotNull="true" dbPosition="11" dbPrimaryKey="true" dbSize="10" dbTypeName="INT" inputType="number" javaName="id" javaType="java.lang.Integer" jdbcTypeCode="4" label="Id" notNull="true" selected="true"/>
            <column dbComment="ElasticSearch source _id" dbDefaultValue="" dbName="_id" dbNotNull="false" dbPosition="12" dbPrimaryKey="false" dbSize="255" dbTypeName="VARCHAR" inputType="text" javaName="_id" javaType="java.lang.String" jdbcTypeCode="12" label="Id" maxLength="255" notNull="true" selected="true"/>
        </table>
        <table catalog="bd_om_analytics" databaseType="TABLE" javaBean="AirtimeReseauDistribution" name="airtime_reseau_distribution" schema="reseau_distribution">
            <column dbComment="ElasticSearch UID field" dbDefaultValue="" dbName="UID" dbNotNull="false" dbPosition="1" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="uID" javaType="java.lang.String" jdbcTypeCode="12" label="UID" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_STK field" dbDefaultValue="" dbName="COMPTE_STK" dbNotNull="false" dbPosition="2" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTESTK" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE STK" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_STK field" dbDefaultValue="" dbName="NOM_STK" dbNotNull="false" dbPosition="3" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMSTK" javaType="java.lang.String" jdbcTypeCode="12" label="NOM STK" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch TYPE_STK field" dbDefaultValue="" dbName="TYPE_STK" dbNotNull="false" dbPosition="4" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="tYPESTK" javaType="java.lang.String" jdbcTypeCode="12" label="TYPE STK" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_COMMERCIAL field" dbDefaultValue="" dbName="COMPTE_COMMERCIAL" dbNotNull="false" dbPosition="5" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTECOMMERCIAL" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE COMMERCIAL" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_COMMERCIAL field" dbDefaultValue="" dbName="NOM_COMMERCIAL" dbNotNull="false" dbPosition="6" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMCOMMERCIAL" javaType="java.lang.String" jdbcTypeCode="12" label="NOM COMMERCIAL" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_DEMI_GROSSISTE field" dbDefaultValue="" dbName="COMPTE_DEMI_GROSSISTE" dbNotNull="false" dbPosition="7" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTEDEMIGROSSISTE" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE DEMI GROSSISTE" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_DEMI_GROSSISTE field" dbDefaultValue="" dbName="NOM_DEMI_GROSSISTE" dbNotNull="false" dbPosition="8" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMDEMIGROSSISTE" javaType="java.lang.String" jdbcTypeCode="12" label="NOM DEMI GROSSISTE" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_PUCE_MERE field" dbDefaultValue="" dbName="COMPTE_PUCE_MERE" dbNotNull="false" dbPosition="9" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTEPUCEMERE" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE PUCE MERE" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_PARTENAIRE field" dbDefaultValue="" dbName="NOM_PARTENAIRE" dbNotNull="false" dbPosition="10" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMPARTENAIRE" javaType="java.lang.String" jdbcTypeCode="12" label="NOM PARTENAIRE" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_CPP field" dbDefaultValue="" dbName="COMPTE_CPP" dbNotNull="false" dbPosition="11" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTECPP" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE CPP" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_MANAGER_OCI field" dbDefaultValue="" dbName="COMPTE_MANAGER_OCI" dbNotNull="false" dbPosition="12" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTEMANAGEROCI" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE MANAGER OCI" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_SPD field" dbDefaultValue="" dbName="COMPTE_SPD" dbNotNull="false" dbPosition="13" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTESPD" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE SPD" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch COMPTE_SUPERVISEUR field" dbDefaultValue="" dbName="COMPTE_SUPERVISEUR" dbNotNull="false" dbPosition="14" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cOMPTESUPERVISEUR" javaType="java.lang.String" jdbcTypeCode="12" label="COMPTE SUPERVISEUR" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch CUID field" dbDefaultValue="" dbName="CUID" dbNotNull="false" dbPosition="15" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cUID" javaType="java.lang.String" jdbcTypeCode="12" label="CUID" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_CPP field" dbDefaultValue="" dbName="NOM_CPP" dbNotNull="false" dbPosition="16" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMCPP" javaType="java.lang.String" jdbcTypeCode="12" label="NOM CPP" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_MANAGER_OCI field" dbDefaultValue="" dbName="NOM_MANAGER_OCI" dbNotNull="false" dbPosition="17" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMMANAGEROCI" javaType="java.lang.String" jdbcTypeCode="12" label="NOM MANAGER OCI" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_SPD field" dbDefaultValue="" dbName="NOM_SPD" dbNotNull="false" dbPosition="18" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMSPD" javaType="java.lang.String" jdbcTypeCode="12" label="NOM SPD" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch NOM_SUPERVISEUR field" dbDefaultValue="" dbName="NOM_SUPERVISEUR" dbNotNull="false" dbPosition="19" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="nOMSUPERVISEUR" javaType="java.lang.String" jdbcTypeCode="12" label="NOM SUPERVISEUR" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch REGION_OCI field" dbDefaultValue="" dbName="REGION_OCI" dbNotNull="false" dbPosition="20" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="rEGIONOCI" javaType="java.lang.String" jdbcTypeCode="12" label="REGION OCI" maxLength="65000" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch TYPE_CODE field" dbDefaultValue="" dbName="TYPE_CODE" dbNotNull="false" dbPosition="21" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="tYPECODE" javaType="java.lang.String" jdbcTypeCode="12" label="TYPE CODE" maxLength="65000" notNull="false" selected="true"/>
            <column dbAutoIncremented="true" dbComment="" dbDefaultValue="" dbName="id" dbNotNull="true" dbPosition="22" dbPrimaryKey="true" dbSize="10" dbTypeName="INT" inputType="number" javaName="id" javaType="java.lang.Integer" jdbcTypeCode="4" label="Id" notNull="true" selected="true"/>
            <column dbComment="ElasticSearch source _id" dbDefaultValue="" dbName="_id" dbNotNull="false" dbPosition="23" dbPrimaryKey="false" dbSize="255" dbTypeName="VARCHAR" inputType="text" javaName="_id" javaType="java.lang.String" jdbcTypeCode="12" label="Id" maxLength="255" notNull="true" selected="true"/>
        </table>
        <table catalog="bd_om_analytics" databaseType="TABLE" javaBean="SubsAggZoneCom" name="subs_agg_zone_com" schema="subs_agg_zone_com">
            <column dbComment="ElasticSearch ACTIVATION field" dbDefaultValue="" dbName="ACTIVATION" dbNotNull="false" dbPosition="1" dbPrimaryKey="false" dbSize="20" dbTypeName="BIGINT" inputType="number" javaName="aCTIVATION" javaType="java.lang.Long" jdbcTypeCode="java.lang.Long" label="ACTIVATION" notNull="false" selected="true"/>
            <column dateType="DT" dbComment="ElasticSearch CREATION_DATE field" dbDefaultValue="" dbName="CREATION_DATE" dbNotNull="false" dbPosition="2" dbPrimaryKey="false" dbSize="19" dbTypeName="DATETIME" inputType="" javaName="cREATIONDATE" javaType="java.util.Date" jdbcTypeCode="93" label="CREATION DATE" notNull="false" selected="true"/>
            <column dbComment="ElasticSearch CHANNEL_ZONE_COMMERCIALE field" dbDefaultValue="" dbName="CHANNEL_ZONE_COMMERCIALE" dbNotNull="false" dbPosition="3" dbPrimaryKey="false" dbSize="65000" dbTypeName="VARCHAR" inputType="text" javaName="cHANNELZONECOMMERCIALE" javaType="java.lang.String" jdbcTypeCode="12" label="CHANNEL ZONE COMMERCIALE" maxLength="65000" notNull="false" selected="true"/>
            <column dbAutoIncremented="true" dbComment="" dbDefaultValue="" dbName="id" dbNotNull="true" dbPosition="4" dbPrimaryKey="true" dbSize="10" dbTypeName="INT" inputType="number" javaName="id" javaType="java.lang.Integer" jdbcTypeCode="4" label="Id" notNull="true" selected="true"/>
            <column dbComment="ElasticSearch source _id" dbDefaultValue="" dbName="_id" dbNotNull="false" dbPosition="5" dbPrimaryKey="false" dbSize="255" dbTypeName="VARCHAR" inputType="text" javaName="_id" javaType="java.lang.String" jdbcTypeCode="12" label="Id" maxLength="255" notNull="true" selected="true"/>
        </table>
    </tableList>
</root>

我不需要编写更多模板。我使用了与从Mysql生成相同的模板,一切都完成了