Compare commits
38 Commits
feat/TBD-1
...
patch/8.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c36ca11190 | ||
|
|
450cf88fbb | ||
|
|
273dbaff1d | ||
|
|
6d502306dc | ||
|
|
4f7bd39423 | ||
|
|
44bfd08c04 | ||
|
|
2237c0b071 | ||
|
|
6c77d40d68 | ||
|
|
0017db5b19 | ||
|
|
09adee337e | ||
|
|
b83227af06 | ||
|
|
16586b7bfa | ||
|
|
c2ce08daeb | ||
|
|
40c71f6911 | ||
|
|
776c0725b6 | ||
|
|
1228c42ed9 | ||
|
|
75df15acaa | ||
|
|
992ae04ae9 | ||
|
|
2b8ff4f36a | ||
|
|
30d8840a31 | ||
|
|
3ea2179438 | ||
|
|
e22daaaedf | ||
|
|
571a496303 | ||
|
|
86171f4473 | ||
|
|
ebe668a985 | ||
|
|
cff7a54f6f | ||
|
|
13309d3297 | ||
|
|
311c5680d3 | ||
|
|
743d863776 | ||
|
|
9a87e0c49e | ||
|
|
78522294dc | ||
|
|
2854fa80b5 | ||
|
|
7389610259 | ||
|
|
ae319f0d85 | ||
|
|
98a80d18b6 | ||
|
|
f878723f81 | ||
|
|
1ac0beea10 | ||
|
|
cc0cab9532 |
@@ -1,280 +1,304 @@
|
||||
<?xml version="1.0"?>
|
||||
<mapping>
|
||||
<dbms product="AMAZON_AURORA" id="amazon_aurora_id" label="Mapping AMAZON_AURORA"
|
||||
default="true">
|
||||
<dbTypes>
|
||||
<dbType type="BIGINT" ignorePre="true"/>
|
||||
<dbType type="BIGINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BINARY" ignorePre="true"/>
|
||||
<dbType type="BIT" ignorePre="true" />
|
||||
<dbType type="BLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHAR" defaultLength="200" ignorePre="true"/>
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DATETIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" preBeforelen="false"/>
|
||||
<dbType type="DOUBLE" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="DOUBLE UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="ENUM" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT" defaultPrecision="2"/>
|
||||
<dbType type="FLOAT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="GEOMETRY" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="GEOMETRYCOLLECTION" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT" ignorePre="true" />
|
||||
<dbType type="INT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LINESTRING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONGTEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONGBLOB" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="MEDIUMBLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MEDIUMINT" ignorePre="true" />
|
||||
<dbType type="MEDIUMINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MEDIUMTEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MULTILINESTRING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MULTIPOINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MULTIPOLYGON" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="POINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="POLYGON" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="SMALLINT" ignorePre="true" />
|
||||
<dbType type="SMALLINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="SET" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYBLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYINT" ignorePre="true" />
|
||||
<dbType type="TINYINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYTEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="VARBINARY" ignorePre="true" />
|
||||
<dbType type="VARCHAR" default="true" defaultLength="100" ignorePre="true"/>
|
||||
<dbType type="YEAR" ignorePre="true"/>
|
||||
</dbTypes>
|
||||
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean">
|
||||
<dbType type="BIT" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="TINYINT" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="INT" />
|
||||
<dbType type="MEDIUMINT" />
|
||||
<dbType type="SMALLINT" />
|
||||
</talendType>
|
||||
<talendType type="id_byte[]">
|
||||
</talendType>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="CHAR" default="true" />
|
||||
<dbType type="VARCHAR"/>
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="DATE" />
|
||||
<dbType type="DATETIME" default="true" />
|
||||
<dbType type="TIME" />
|
||||
<dbType type="YEAR" />
|
||||
<dbType type="TIMESTAMP" />
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="DECIMAL" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DOUBLE" />
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="DOUBLE" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DECIMAL" />
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
<dbType type="DOUBLE"/>
|
||||
<dbType type="DECIMAL" />
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INT" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="BIGINT" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="BLOB" default="true"/>
|
||||
<dbType type="ENUM" />
|
||||
<dbType type="GEOMETRY" />
|
||||
<dbType type="GEOMETRYCOLLECTION" />
|
||||
<dbType type="MEDIUMINT" />
|
||||
<dbType type="LONGBLOB" />
|
||||
<dbType type="MEDIUMBLOB" />
|
||||
<dbType type="MULTIPOINT" />
|
||||
<dbType type="MULTIPOLYGON" />
|
||||
<dbType type="POINT" />
|
||||
<dbType type="POLYGON" />
|
||||
<dbType type="SET" />
|
||||
<dbType type="TINYBLOB" />
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SMALLINT" default="true" />
|
||||
<dbType type="INT" />
|
||||
<dbType type="BIGINT"/>
|
||||
<dbType type="MEDIUMINT" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="VARCHAR" default="true" />
|
||||
<dbType type="LINESTRING" />
|
||||
<dbType type="LONGTEXT"/>
|
||||
<dbType type="MEDIUMTEXT" />
|
||||
<dbType type="MULTILINESTRING" />
|
||||
<dbType type="TEXT" />
|
||||
<dbType type="TINYTEXT" />
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes>
|
||||
<dbType type="BIGINT">
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BINARY">
|
||||
<talendType type="id_Boolean" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIT">
|
||||
<talendType type="id_Boolean" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BLOB">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="CHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DATETIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DECIMAL">
|
||||
<talendType type="id_Float"/>
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="DOUBLE">
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="ENUM">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="GEOMETRY">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="GEOMETRYCOLLECTION">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INT">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="LINESTRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONGTEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONGBLOB">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MEDIUMBLOB">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MEDIUMINT">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="MEDIUMTEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MULTILINESTRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MULTIPOINT">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MULTIPOLYGON">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="POINT">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="POLYGON">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="SMALLINT">
|
||||
<talendType type="id_Short" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
<talendType type="id_Integer"/>
|
||||
</dbType>
|
||||
<dbType type="SET">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TINYBLOB">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TINYINT">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
<talendType type="id_Integer"/>
|
||||
<talendType type="id_Long"/>
|
||||
<talendType type="id_Short"/>
|
||||
</dbType>
|
||||
<dbType type="TINYTEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="VARBINARY">
|
||||
</dbType>
|
||||
<dbType type="VARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="YEAR">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIGINT UNSIGNED" >
|
||||
</dbType>
|
||||
<dbType type="DOUBLE UNSIGNED" >
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="FLOAT UNSIGNED" >
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="INT UNSIGNED" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MEDIUMINT UNSIGNED" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
<dbType type="SMALLINT UNSIGNED" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
<dbType type="TINYINT UNSIGNED" >
|
||||
<talendType type="id_Short" default="true" />
|
||||
<talendType type="id_Integer" />
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
|
||||
</mapping>
|
||||
<?xml version="1.0"?>
|
||||
<mapping>
|
||||
<dbms product="AMAZON_AURORA" id="amazon_aurora_id" label="Mapping AMAZON_AURORA"
|
||||
default="true">
|
||||
<dbTypes>
|
||||
<dbType type="BIGINT" ignorePre="true"/>
|
||||
<dbType type="BIGINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BINARY" ignorePre="true"/>
|
||||
<dbType type="BIT" ignorePre="true" />
|
||||
<dbType type="BLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHAR" defaultLength="200" ignorePre="true"/>
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DATETIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" preBeforelen="false"/>
|
||||
<dbType type="DOUBLE" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="DOUBLE UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="ENUM" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT" defaultPrecision="2"/>
|
||||
<dbType type="FLOAT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="GEOMETRY" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="GEOMETRYCOLLECTION" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT" ignorePre="true" />
|
||||
<dbType type="INT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER" ignorePre="true" />
|
||||
<dbType type="INTEGER UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LINESTRING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONGTEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONGBLOB" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="MEDIUMBLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MEDIUMINT" ignorePre="true" />
|
||||
<dbType type="MEDIUMINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MEDIUMTEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MULTILINESTRING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MULTIPOINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MULTIPOLYGON" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="POINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="POLYGON" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="SMALLINT" ignorePre="true" />
|
||||
<dbType type="SMALLINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="SET" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="false" />
|
||||
<dbType type="TINYBLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYINT" ignorePre="true" />
|
||||
<dbType type="TINYINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYTEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="VARBINARY" ignorePre="true" />
|
||||
<dbType type="VARCHAR" default="true" defaultLength="100" ignorePre="true"/>
|
||||
<dbType type="YEAR" ignorePre="true"/>
|
||||
</dbTypes>
|
||||
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean">
|
||||
<dbType type="BIT" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="TINYINT" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="INT" />
|
||||
<dbType type="MEDIUMINT" />
|
||||
<dbType type="SMALLINT" />
|
||||
</talendType>
|
||||
<talendType type="id_byte[]">
|
||||
<dbType type="VARBINARY" default="true" />
|
||||
<dbType type="BINARY" />
|
||||
<dbType type="BIT" />
|
||||
<dbType type="BLOB" />
|
||||
<dbType type="LONGBLOB" />
|
||||
<dbType type="MEDIUMBLOB" />
|
||||
<dbType type="TINYBLOB" />
|
||||
</talendType>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="CHAR" default="true" />
|
||||
<dbType type="VARCHAR"/>
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="DATE" />
|
||||
<dbType type="DATETIME" default="true" />
|
||||
<dbType type="TIME" />
|
||||
<dbType type="YEAR" />
|
||||
<dbType type="TIMESTAMP" />
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="DECIMAL" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DOUBLE" />
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="DOUBLE" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DECIMAL" />
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
<dbType type="DOUBLE"/>
|
||||
<dbType type="DECIMAL" />
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INT" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="BIGINT" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="BLOB" default="true"/>
|
||||
<dbType type="ENUM" />
|
||||
<dbType type="GEOMETRY" />
|
||||
<dbType type="GEOMETRYCOLLECTION" />
|
||||
<dbType type="MEDIUMINT" />
|
||||
<dbType type="LONGBLOB" />
|
||||
<dbType type="MEDIUMBLOB" />
|
||||
<dbType type="MULTIPOINT" />
|
||||
<dbType type="MULTIPOLYGON" />
|
||||
<dbType type="POINT" />
|
||||
<dbType type="POLYGON" />
|
||||
<dbType type="SET" />
|
||||
<dbType type="TINYBLOB" />
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SMALLINT" default="true" />
|
||||
<dbType type="INT" />
|
||||
<dbType type="BIGINT"/>
|
||||
<dbType type="MEDIUMINT" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="VARCHAR" default="true" />
|
||||
<dbType type="LINESTRING" />
|
||||
<dbType type="LONGTEXT"/>
|
||||
<dbType type="MEDIUMTEXT" />
|
||||
<dbType type="MULTILINESTRING" />
|
||||
<dbType type="TEXT" />
|
||||
<dbType type="TINYTEXT" />
|
||||
<dbType type="CHAR" />
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes>
|
||||
<dbType type="BIGINT">
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BINARY">
|
||||
<talendType type="id_byte[]" />
|
||||
<talendType type="id_Boolean" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIT">
|
||||
<talendType type="id_byte[]" />
|
||||
<talendType type="id_Boolean" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BLOB">
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
<talendType type="id_Object" />
|
||||
</dbType>
|
||||
<dbType type="CHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DATETIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DECIMAL">
|
||||
<talendType type="id_Float"/>
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="DOUBLE">
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="ENUM">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="GEOMETRY">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="GEOMETRYCOLLECTION">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INT">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="INTEGER">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="LINESTRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONGTEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONGBLOB">
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
<talendType type="id_Object" />
|
||||
</dbType>
|
||||
<dbType type="MEDIUMBLOB">
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
<talendType type="id_Object" />
|
||||
</dbType>
|
||||
<dbType type="MEDIUMINT">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="MEDIUMTEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MULTILINESTRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MULTIPOINT">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MULTIPOLYGON">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="POINT">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="POLYGON">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="SMALLINT">
|
||||
<talendType type="id_Short" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
<talendType type="id_Integer"/>
|
||||
</dbType>
|
||||
<dbType type="SET">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TINYBLOB">
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
<talendType type="id_Object" />
|
||||
</dbType>
|
||||
<dbType type="TINYINT">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
<talendType type="id_Integer"/>
|
||||
<talendType type="id_Long"/>
|
||||
<talendType type="id_Short"/>
|
||||
</dbType>
|
||||
<dbType type="TINYTEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="VARBINARY">
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
</dbType>
|
||||
<dbType type="VARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="YEAR">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIGINT UNSIGNED" >
|
||||
</dbType>
|
||||
<dbType type="DOUBLE UNSIGNED" >
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="FLOAT UNSIGNED" >
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="INT UNSIGNED" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INTEGER UNSIGNED" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MEDIUMINT UNSIGNED" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
<dbType type="SMALLINT UNSIGNED" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
<dbType type="TINYINT UNSIGNED" >
|
||||
<talendType type="id_Short" default="true" />
|
||||
<talendType type="id_Integer" />
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
|
||||
</mapping>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<dbType type="INT" ignorePre="true" />
|
||||
<dbType type="INT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER" ignorePre="true" />
|
||||
<dbType type="INTEGER UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LINESTRING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONGTEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONGBLOB" ignoreLen="true" ignorePre="true"/>
|
||||
@@ -190,9 +190,9 @@
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="INTEGER">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="LINESTRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
@@ -282,8 +282,8 @@
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INTEGER UNSIGNED" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MEDIUMINT UNSIGNED" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long" />
|
||||
|
||||
@@ -77,6 +77,8 @@ public interface ILibraryManagerService extends IService {
|
||||
public void saveMavenIndex(Map<String, String> libsToMavenUri, IProgressMonitor... monitorWrap);
|
||||
|
||||
public void createModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap);
|
||||
|
||||
public Map<String,String> buildModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap);
|
||||
|
||||
/**
|
||||
* DOC ycbai Comment method "retrieve".
|
||||
|
||||
@@ -149,7 +149,9 @@ public enum EDatabaseTypeName {
|
||||
"HBase", "HBase", Boolean.FALSE, "HBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
MAPRDB(
|
||||
"MapRDB", "MapRDB", Boolean.FALSE, "MAPRDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"MapRDB", "MapRDB", Boolean.FALSE, "MAPRDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true),//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
SNOWFLAKE(
|
||||
"SNOWFLAKE","SNOWFLAKE",Boolean.TRUE,"SNOWFLAKE",EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.None);
|
||||
|
||||
// displayName is used in Java code.
|
||||
private String displayName;
|
||||
|
||||
@@ -214,6 +214,36 @@ public class ConnParameterKeys {
|
||||
|
||||
/******************************************/
|
||||
|
||||
/*********** Azure Synapse keys ***************/
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_HOST = "CONN_PARA_KEY_SYNAPSE_HOST"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN = "CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_SPARK_POOLS = "CONN_PARA_KEY_SYNAPSE_SPARK_POOLS"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME = "CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_CONTAINER = "CONN_PARA_KEY_SYNAPSE_FS_CONTAINER"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_USERNAME = "CONN_PARA_KEY_SYNAPSE_FS_USERNAME"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_PASSWORD = "CONN_PARA_KEY_SYNAPSE_FS_PASSWORD"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_STORAGE = "CONN_PARA_KEY_SYNAPSE_FS_STORAGE"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB = "CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_DRIVER_MEMORY = "CONN_PARA_KEY_DRIVER_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_DRIVER_CORES = "CONN_PARA_KEY_DRIVER_CORES"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_EXECUTOR_MEMORY = "CONN_PARA_KEY_EXECUTOR_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_TUNING_PROPERTIES = "CONN_PARA_KEY_TUNING_PROPERTIES"; //$NON-NLS-1$
|
||||
|
||||
/******************************************/
|
||||
|
||||
/**
|
||||
* HBase keys.
|
||||
*/
|
||||
@@ -321,6 +351,8 @@ public class ConnParameterKeys {
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_ENDPOINT="CONN_PARA_KEY_DATABRICKS_ENDPOINT";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER = "CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_RUN_MODE = "CONN_PARA_KEY_DATABRICKS_RUN_MODE";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_ID="CONN_PARA_KEY_DATABRICKS_CLUSTER_ID";
|
||||
|
||||
|
||||
@@ -85,10 +85,10 @@ public enum EDatabaseVersion4Drivers {
|
||||
"Microsoft SQL Server 2012", "Microsoft SQL Server 2012", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.25.jar", "slf4j-log4j12-1.7.25.jar", "adal4j-1.6.5.jar", //$NON-NLS-1$
|
||||
"commons-lang3-3.10.jar", "commons-codec-1.14.jar", "gson-2.8.6.jar", "oauth2-oidc-sdk-6.5.jar",
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.25.jar", "slf4j-log4j12-1.7.25.jar", "adal4j-1.6.7.jar", //$NON-NLS-1$
|
||||
"commons-lang3-3.10.jar", "commons-codec-1.14.jar", "gson-2.8.6.jar", "oauth2-oidc-sdk-9.7.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-8.11.jar", "javax.mail-1.6.2.jar", "log4j-1.2.17.jar",
|
||||
"accessors-smart-2.4.7.jar", "asm-9.1.jar" })),
|
||||
"accessors-smart-2.4.7.jar", "asm-9.1.jar", "content-type-2.1.jar" })),
|
||||
|
||||
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
VERTICA_7_1_X(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 7.1.X (Deprecated)", "VERTICA_7_1_X", "vertica-jdbc-7.1.2-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
@@ -101,22 +101,59 @@ public enum EHadoopProperties {
|
||||
HD_AZURE_DEPLOYBOLB,
|
||||
|
||||
HD_JOB_RESULT_FOLDER,
|
||||
|
||||
|
||||
SYNAPSE_ENDPOINT,
|
||||
|
||||
SYNAPSE_TOKEN,
|
||||
|
||||
SPARK_POOL_NAME,
|
||||
|
||||
SYNAPSE_STORAGE_HOST,
|
||||
|
||||
SYNAPSE_STORAGE_CONTAINER,
|
||||
|
||||
SYNAPSE_STORAGE_USERNAME,
|
||||
|
||||
SYNAPSE_STORAGE_PASSWORD,
|
||||
|
||||
DEPLOY_FOLDER,
|
||||
|
||||
SPARK_DRIVER_MEM,
|
||||
|
||||
SPARK_DRIVER_CORES,
|
||||
|
||||
SPARK_EXECUTOR_MEMORY,
|
||||
|
||||
QUBOLE_API_TOKEN,
|
||||
|
||||
QUBOLE_CLUSTER,
|
||||
|
||||
QUBOLE_CLUSTER_LABEL,
|
||||
|
||||
QUBOLE_ENDPOINT,
|
||||
|
||||
QUBOLE_ENDPOINT_URL,
|
||||
|
||||
QUBOLE_S3_ACCESS_KEY,
|
||||
|
||||
QUBOLE_S3_SECRET_KEY,
|
||||
|
||||
QUBOLE_S3_BUCKET_NAME,
|
||||
|
||||
QUBOLE_S3_BUCKET_KEY,
|
||||
|
||||
QUBOLE_S3_REGION,
|
||||
|
||||
DATABRICKS_ENDPOINT,
|
||||
|
||||
DATABRICKS_CLOUD_PROVIDER,
|
||||
|
||||
DATABRICKS_RUN_MODE,
|
||||
|
||||
DATABRICKS_CLUSTER_ID,
|
||||
|
||||
DATABRICKS_TOKEN,
|
||||
|
||||
DATABRICKS_DBFS_DEP_FOLDER;
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -34,6 +34,8 @@ public enum EHadoopDistributions {
|
||||
PIVOTAL_HD("Pivotal HD"), //$NON-NLS-1$
|
||||
|
||||
MICROSOFT_HD_INSIGHT("Microsoft HD Insight"), //$NON-NLS-1$
|
||||
|
||||
AZURE_SYNAPSE("Azure Synapse Runtime for Apache Spark 3.0"), //$NON-NLS-1$
|
||||
|
||||
GOOGLE_CLOUD_DATAPROC("Google Cloud Dataproc"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.hadoop.version;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum ESynapseStorage {
|
||||
|
||||
ADLS_GEN2("ADLS Gen2"); //$NON-NLS-1$
|
||||
|
||||
private String displayName;
|
||||
|
||||
ESynapseStorage(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public static List<String> getAllSynapseStorageDisplayNames() {
|
||||
return getAllSynapseStorageNames(true);
|
||||
}
|
||||
|
||||
public static List<String> getAllSynapseStorageNames(boolean display) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
ESynapseStorage[] values = values();
|
||||
for (ESynapseStorage storage : values) {
|
||||
if (display) {
|
||||
names.add(storage.getDisplayName());
|
||||
} else {
|
||||
names.add(storage.getName());
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static ESynapseStorage getSynapseStoragenByDisplayName(String name) {
|
||||
return getSynapseStorageByName(name, true);
|
||||
}
|
||||
|
||||
public static ESynapseStorage getSynapseStorageByName(String name, boolean display) {
|
||||
if (name != null) {
|
||||
for (ESynapseStorage storage : values()) {
|
||||
if (display) {
|
||||
if (name.equalsIgnoreCase(storage.getDisplayName())) {
|
||||
return storage;
|
||||
}
|
||||
} else {
|
||||
if (name.equalsIgnoreCase(storage.getName())) {
|
||||
return storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,14 @@ package org.talend.core.model.general;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.osgi.framework.Version;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
import org.talend.core.database.conn.version.DatabaseDriversCache;
|
||||
@@ -29,6 +31,9 @@ import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.utils.json.JSONException;
|
||||
import org.talend.utils.json.JSONObject;
|
||||
import org.talend.utils.json.JSONTokener;
|
||||
|
||||
/**
|
||||
* This bean is use to manage needed moduless (perl) and libraries (java).<br/>
|
||||
@@ -38,6 +43,10 @@ import org.talend.core.utils.TalendQuoteUtils;
|
||||
*/
|
||||
public class ModuleNeeded {
|
||||
|
||||
public static final String ATTR_USED_BY_DYNAMIC_DISTRIBUTION = "dynamicDistribution";
|
||||
|
||||
public static final String ATTR_DYNAMIC_DISTRIBUTION_VERSION = "distributionVersion";
|
||||
|
||||
private String id;
|
||||
|
||||
private String context;
|
||||
@@ -94,8 +103,11 @@ public class ModuleNeeded {
|
||||
*/
|
||||
private boolean useReleaseVersion = false;
|
||||
|
||||
private Map<String, String> attributes;
|
||||
|
||||
ILibraryManagerService libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
|
||||
.getService(ILibraryManagerService.class);
|
||||
|
||||
|
||||
/**
|
||||
* DOC smallet ModuleNeeded class global comment. Detailled comment <br/>
|
||||
@@ -162,6 +174,10 @@ public class ModuleNeeded {
|
||||
this.required = required;
|
||||
this.installURL = installURL;
|
||||
this.requiredIf = requiredIf;
|
||||
this.attributes = analyseMessage(informationMsg);
|
||||
if (!this.attributes.isEmpty()) {
|
||||
this.informationMsg = "";
|
||||
}
|
||||
String name = moduleName;
|
||||
String uri = mavenUrl;
|
||||
if (moduleName != null) {
|
||||
@@ -184,6 +200,32 @@ public class ModuleNeeded {
|
||||
setMavenUri(uri);
|
||||
}
|
||||
|
||||
private Map<String, String> analyseMessage(String msg) {
|
||||
Map<String, String> attrMap = new HashMap<>();
|
||||
if (StringUtils.isBlank(msg) || !msg.startsWith("{") || !msg.endsWith("}")) {
|
||||
return attrMap;
|
||||
}
|
||||
try {
|
||||
JSONObject jo = new JSONObject(new JSONTokener(msg));
|
||||
Iterator<String> keys = jo.keys();
|
||||
keys.forEachRemaining(key -> {
|
||||
try {
|
||||
Object object = jo.get(key);
|
||||
if (object != null) {
|
||||
attrMap.put(key, object.toString());
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
if (Boolean.getBoolean("talend.studio.moduleNeeded.init.debug")) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return attrMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleNeeded clone() {
|
||||
ModuleNeeded cloned = new ModuleNeeded(context, moduleName, informationMsg, mrRequired, installURL, requiredIf, mavenUri);
|
||||
@@ -212,6 +254,7 @@ public class ModuleNeeded {
|
||||
cloned.requiredIf = requiredIf;
|
||||
cloned.status = status;
|
||||
cloned.useReleaseVersion = useReleaseVersion;
|
||||
cloned.attributes = attributes;
|
||||
|
||||
return cloned;
|
||||
}
|
||||
@@ -671,6 +714,10 @@ public class ModuleNeeded {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean usedByDynamicDistribution() {
|
||||
return Boolean.valueOf(attributes.get(ATTR_USED_BY_DYNAMIC_DISTRIBUTION));
|
||||
}
|
||||
|
||||
public boolean isDynamic() {
|
||||
return this.dynamic;
|
||||
}
|
||||
@@ -709,5 +756,12 @@ public class ModuleNeeded {
|
||||
public void setUseReleaseVersion(boolean useReleaseVersion) {
|
||||
this.useReleaseVersion = useReleaseVersion;
|
||||
}
|
||||
|
||||
|
||||
public String getDynamicDistributionVersion() {
|
||||
return attributes.get(ATTR_DYNAMIC_DISTRIBUTION_VERSION);
|
||||
}
|
||||
|
||||
public void setDynamicDistributionVersion(String distribution) {
|
||||
attributes.put(ATTR_DYNAMIC_DISTRIBUTION_VERSION, distribution);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,6 +295,9 @@ public class MetadataTable implements IMetadataTable, Cloneable {
|
||||
// no matter if this one is custom or not (all custom must be propagated too)
|
||||
for (int i = 0; i < inputColumnListWithUnselected.size(); i++) {
|
||||
IMetadataColumn inputColumn = inputColumnListWithUnselected.get(i);
|
||||
if(inputColumn.isCustom()) {
|
||||
continue;
|
||||
}
|
||||
IMetadataColumn myColumn = this.getColumn(inputColumn.getLabel());
|
||||
outputColumnsNotTested.remove(myColumn);
|
||||
if (!inputColumn.sameMetacolumnAs(myColumn, options)) {
|
||||
|
||||
@@ -16,8 +16,8 @@ package org.talend.core.model.metadata.designerproperties;
|
||||
* DOC talend class global comment. Detailled comment
|
||||
*/
|
||||
public enum SapJcoVersion {
|
||||
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$
|
||||
SAP3("sap jco 3.*", "sapjco3.jar");//$NON-NLS-1$
|
||||
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAP3("sap jco 3.*", "com.sap.conn.jco.sapjco.jar");//$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private String displayName;
|
||||
|
||||
|
||||
@@ -139,4 +139,8 @@ public enum EParameterFieldType {
|
||||
}
|
||||
return TEXT; // Default Value
|
||||
}
|
||||
|
||||
public static boolean isPassword(EParameterFieldType type) {
|
||||
return EParameterFieldType.PASSWORD.equals(type) || EParameterFieldType.LICENSEKEY.equals(type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1492,4 +1492,29 @@ public class NodeUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* TUP-32758:Used to judge if two components are compatible from name
|
||||
* for example tAmazonMysqlConnection and tMysqlConnection ,tAmazonOracleCommit and tOracleCommit
|
||||
*/
|
||||
public static boolean isCompatibleByName(String componentName1, String componentName2) {
|
||||
boolean isCompatable = false;
|
||||
if ( componentName1 ==null || componentName2 == null
|
||||
|| componentName1.length()<1 || componentName2.length() < 1) return false;
|
||||
if (componentName1.replaceFirst("t", "tAmazon").equals(componentName2) ||
|
||||
componentName2.replaceFirst("t", "tAmazon").equals(componentName1)) {
|
||||
isCompatable = true;
|
||||
}
|
||||
return isCompatable;
|
||||
}
|
||||
|
||||
public static boolean isDatabaseFamily(String orginalFamilyName) {
|
||||
boolean isDatabaseFamily = false;
|
||||
String rootFamily = "";
|
||||
rootFamily = orginalFamilyName != null ? orginalFamilyName.split("/")[0] : "";
|
||||
if (rootFamily.equals("Databases")) {
|
||||
isDatabaseFamily = true;
|
||||
}
|
||||
return isDatabaseFamily;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.runtime.services;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
@@ -25,6 +30,10 @@ public interface IDesignerMavenService extends IService {
|
||||
|
||||
void updateCodeJarMavenProject(CodesJarInfo info, boolean needReSync) throws Exception;
|
||||
|
||||
void enableMavenNature(IProgressMonitor monitor, IProject project);
|
||||
|
||||
void addProjectClasspathEntry(IProgressMonitor monitor, IProject project, List<IClasspathEntry> entries);
|
||||
|
||||
public static IDesignerMavenService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMavenService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IDesignerMavenService.class);
|
||||
|
||||
@@ -264,6 +264,40 @@ public final class TalendQuoteUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isStartEndsWithQuotation(String expression, boolean checkStart, boolean checkEnd) {
|
||||
if (StringUtils.isBlank(expression)) {
|
||||
return false;
|
||||
}
|
||||
boolean startsWith = false;
|
||||
boolean endsWith = false;
|
||||
|
||||
ECodeLanguage language = LanguageManager.getCurrentLanguage();
|
||||
switch (language) {
|
||||
case JAVA:
|
||||
startsWith = expression.startsWith(QUOTATION_MARK);
|
||||
endsWith = expression.endsWith(QUOTATION_MARK);
|
||||
if (checkStart && checkEnd) {
|
||||
return startsWith & endsWith;
|
||||
} else if (checkStart) {
|
||||
return startsWith;
|
||||
} else if (checkEnd) {
|
||||
return endsWith;
|
||||
}
|
||||
default: // PERL
|
||||
startsWith = expression.startsWith(SINGLE_QUOTE);
|
||||
endsWith = expression.endsWith(SINGLE_QUOTE);
|
||||
if (checkStart && checkEnd) {
|
||||
return startsWith & endsWith;
|
||||
} else if (checkStart) {
|
||||
return startsWith;
|
||||
} else if (checkEnd) {
|
||||
return endsWith;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String removeQuotes(String text, String quotation) {
|
||||
if (text == null) {
|
||||
return null;
|
||||
@@ -429,6 +463,8 @@ public final class TalendQuoteUtils {
|
||||
return QUOTATION_MARK;
|
||||
case H2:
|
||||
return QUOTATION_ESC_MARK;
|
||||
case SNOWFLAKE:
|
||||
return QUOTATION_MARK;
|
||||
// case JAVADB_DERBYCLIENT:
|
||||
// return QUOTATION_MARK;
|
||||
// case JAVADB_JCCJDBC:
|
||||
|
||||
@@ -234,6 +234,8 @@ public interface IRunProcessService extends IService {
|
||||
|
||||
void clearProjectRelatedSettings();
|
||||
|
||||
void clearAllBuildCaches();
|
||||
|
||||
void batchDeleteAllVersionTalendJobProject(List<String> idList);
|
||||
|
||||
boolean isExportConfig();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/log4j-api-2.12.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/log4j-core-2.12.1.jar"/>
|
||||
<classpathentry kind="src" path="src/main/java/"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/log4j-api-2.17.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/log4j-core-2.17.1.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src/main/java/"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
||||
@@ -55,6 +55,6 @@ Export-Package: org.talend.core,
|
||||
org.talend.core.views,
|
||||
org.talend.designer.runprocess
|
||||
Import-Package: org.apache.commons.collections4.map
|
||||
Bundle-ClassPath: lib/log4j-api-2.12.1.jar,
|
||||
lib/log4j-core-2.12.1.jar,
|
||||
.
|
||||
Bundle-ClassPath: .,
|
||||
lib/log4j-api-2.17.1.jar,
|
||||
lib/log4j-core-2.17.1.jar
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.apache.logging.log4j.core.config.builder.api.RootLoggerComponentBuild
|
||||
import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceDescription;
|
||||
@@ -56,13 +57,15 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.jdt.core.IClasspathAttribute;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
|
||||
import org.talend.commons.runtime.utils.io.FileCopyUtils;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.time.TimeMeasure;
|
||||
@@ -119,6 +122,7 @@ import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
import org.talend.core.runtime.process.TalendProcessOptionConstants;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.core.runtime.repository.build.BuildExportManager;
|
||||
import org.talend.core.runtime.services.IDesignerMavenService;
|
||||
import org.talend.core.service.IResourcesDependenciesService;
|
||||
import org.talend.core.services.ICoreTisService;
|
||||
import org.talend.core.services.ISVNProviderService;
|
||||
@@ -1275,39 +1279,6 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
|
||||
private static void syncContextResourcesForParentJob(IProcess currentProcess, IProgressMonitor progressMonitor) {
|
||||
ITalendProcessJavaProject processJavaProject = mainJobInfo.getProcessor().getTalendJavaProject();
|
||||
|
||||
final IFolder mainResourcesFolder = processJavaProject.getExternalResourcesFolder();
|
||||
final File targetFolder = mainResourcesFolder.getLocation().toFile();
|
||||
|
||||
final Set<JobInfo> dependenciesItems = mainJobInfo.getProcessor().getBuildChildrenJobs();
|
||||
|
||||
final IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
|
||||
IRunProcessService.class);
|
||||
|
||||
List<ProcessItem> dependenciesItemsFiltered = dependenciesItems.stream().filter(jobInfo -> !jobInfo.isJoblet())
|
||||
.map(JobInfo::getProcessItem).collect(Collectors.toList());
|
||||
|
||||
if (dependenciesItemsFiltered.size() > 0) {
|
||||
dependenciesItemsFiltered.forEach(item -> {
|
||||
ITalendProcessJavaProject childJavaProject = runProcessService.getTalendJobJavaProject(item.getProperty());
|
||||
if (childJavaProject != null) {
|
||||
final IFolder childResourcesFolder = childJavaProject.getExternalResourcesFolder();
|
||||
if (childResourcesFolder.exists()) {
|
||||
FileCopyUtils.syncFolder(childResourcesFolder.getLocation().toFile(), targetFolder, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
mainResourcesFolder.refreshLocal(IResource.DEPTH_INFINITE, progressMonitor);
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Set<ModuleNeeded> getAllJobTestcaseModules(ProcessItem selectedProcessItem) {
|
||||
Set<ModuleNeeded> neededLibraries = new HashSet<>();
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
|
||||
@@ -1514,7 +1485,6 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
}
|
||||
syncContextResourcesForParentJob(currentProcess, progressMonitor);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1570,6 +1540,7 @@ public class ProcessorUtilities {
|
||||
}
|
||||
jobInfo.setProcessItem(null);
|
||||
if (!BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
|
||||
List<JobInfo> firstSubjobs = new ArrayList<JobInfo>();
|
||||
// handle subjob in joblet. see bug 004937: tRunJob in a Joblet
|
||||
for (INode node : currentProcess.getGeneratingNodes()) {
|
||||
String componentName = node.getComponent().getName();
|
||||
@@ -1658,6 +1629,8 @@ public class ProcessorUtilities {
|
||||
|
||||
if (!BitwiseOptionUtils.containOption(option, GENERATE_WITH_FIRST_CHILD)) {
|
||||
currentProcess.setNeedRegenerateCode(true);
|
||||
} else {
|
||||
firstSubjobs.add(subJobInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1666,6 +1639,9 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (BitwiseOptionUtils.containOption(option, GENERATE_WITH_FIRST_CHILD)) {
|
||||
handleGenerateFirstChildOnlyClasspath(progressMonitor, jobInfo, firstSubjobs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1675,6 +1651,32 @@ public class ProcessorUtilities {
|
||||
jobInfo.setIncludeESBFlag(includeESBFlag);
|
||||
}
|
||||
|
||||
private static void handleGenerateFirstChildOnlyClasspath(IProgressMonitor progressMonitor, JobInfo jobInfo,
|
||||
List<JobInfo> subjobInfoList) {
|
||||
IDesignerMavenService mavenService = IDesignerMavenService.get();
|
||||
if (mavenService == null || jobInfo == null || subjobInfoList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<IClasspathEntry> classpathEntries = new ArrayList<IClasspathEntry>();
|
||||
for (JobInfo subJobInfo : subjobInfoList) {
|
||||
if (subJobInfo.getProcessor() != null) {
|
||||
IProject codeProject = subJobInfo.getProcessor().getCodeProject();
|
||||
if (codeProject != null) {
|
||||
mavenService.enableMavenNature(progressMonitor, codeProject);
|
||||
IClasspathEntry classpathEntry = JavaCore.newSourceEntry(codeProject.getFullPath(), new IPath[0],
|
||||
new IPath[0], null, new IClasspathAttribute[] {});
|
||||
classpathEntries.add(classpathEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jobInfo.getProcessor() != null) {
|
||||
IProject codeProject = jobInfo.getProcessor().getCodeProject();
|
||||
if (codeProject != null) {
|
||||
mavenService.addProjectClasspathEntry(progressMonitor, codeProject, classpathEntries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void setGenerationInfoWithChildrenJob(INode node, JobInfo jobInfo, final JobInfo subJobInfo) {
|
||||
final LastGenerationInfo generationInfo = LastGenerationInfo.getInstance();
|
||||
|
||||
@@ -2048,7 +2050,7 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static IProcessor generateCode(IProcess process, IContext context, boolean statistics, boolean trace,
|
||||
boolean properties, int option) throws ProcessorException {
|
||||
boolean properties, int option, IProgressMonitor progressMonitor) throws ProcessorException {
|
||||
// added by nma, to refresh routines when generating code in SVN mode. 10225.
|
||||
ISVNProviderService service = null;
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
@@ -2060,8 +2062,7 @@ public class ProcessorUtilities {
|
||||
// achen modify to fix 0006107
|
||||
JobInfo jobInfo = new JobInfo(process, context);
|
||||
resetBuildFlagsAndCaches();
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties, option,
|
||||
new NullProgressMonitor());
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties, option, progressMonitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
return genCode;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,17 @@
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-http</artifactId>
|
||||
<version>${wagon.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -94,6 +98,11 @@
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -14,22 +14,22 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-1.2-api</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
@@ -55,4 +55,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -21,6 +21,6 @@
|
||||
</modules>
|
||||
<properties>
|
||||
<m2.fasterxml.jackson.version>2.11.4</m2.fasterxml.jackson.version>
|
||||
<jackson-codehaus.version>1.9.15-TALEND</jackson-codehaus.version>
|
||||
<jackson-codehaus.version>1.9.16-TALEND</jackson-codehaus.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.25.0</tacokit.components.version>
|
||||
<tacokit.components.version>1.27.0</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
</parent>
|
||||
<artifactId>studio-tcompv1-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.36.1</tcomp.version>
|
||||
<tcomp.version>1.38.5</tcomp.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>talend_open</id>
|
||||
@@ -57,9 +58,49 @@
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-jul</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-jcl</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-1.2-api</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-web</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.talend.sdk.component</groupId>
|
||||
<artifactId>component-runtime</artifactId>
|
||||
@@ -69,7 +110,7 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.talend.sdk.component</groupId>
|
||||
@@ -112,7 +153,7 @@
|
||||
<version>1.14</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<artifactItem>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository</artifactId>
|
||||
<version>7.3.1.v20210907</version>
|
||||
<version>7.3.1.v20211025</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${project.basedir}/../repository</outputDirectory>
|
||||
|
||||
@@ -12,11 +12,17 @@
|
||||
// ============================================================================
|
||||
package org.talend.designer.maven;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.runtime.services.IDesignerMavenService;
|
||||
import org.talend.designer.maven.tools.CodesJarM2CacheManager;
|
||||
import org.talend.designer.maven.utils.CodesJarMavenUtil;
|
||||
import org.talend.designer.maven.utils.MavenProjectUtils;
|
||||
|
||||
public class DesignerMavenService implements IDesignerMavenService {
|
||||
|
||||
@@ -35,4 +41,14 @@ public class DesignerMavenService implements IDesignerMavenService {
|
||||
CodesJarM2CacheManager.updateCodesJarProject(info, needReSync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableMavenNature(IProgressMonitor monitor, IProject project) {
|
||||
MavenProjectUtils.enableMavenNature(monitor, project);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addProjectClasspathEntry(IProgressMonitor monitor, IProject project, List<IClasspathEntry> entries) {
|
||||
MavenProjectUtils.addProjectClasspathEntry(monitor, project, entries);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -894,7 +894,7 @@ public class AggregatorPomsHelper {
|
||||
} else {
|
||||
model.getModules().addAll(collectRefProjectModules(null));
|
||||
}
|
||||
boolean isCIMode = false;
|
||||
Boolean isCIMode = false;
|
||||
if (IRunProcessService.get() != null) {
|
||||
isCIMode = IRunProcessService.get().isCIMode();
|
||||
}
|
||||
@@ -909,15 +909,10 @@ public class AggregatorPomsHelper {
|
||||
// codes pom
|
||||
monitor.subTask("Synchronize code poms"); //$NON-NLS-1$
|
||||
|
||||
if (isCIMode) {
|
||||
System.setProperty("ignore.ci.mode", Boolean.TRUE.toString());
|
||||
updateCodeProjects(monitor, true, true);
|
||||
System.setProperty("ignore.ci.mode", Boolean.FALSE.toString());
|
||||
} else {
|
||||
updateCodeProjects(monitor, true, true);
|
||||
}
|
||||
|
||||
System.setProperty("ignore.ci.mode", isCIMode.toString());
|
||||
updateCodeProjects(monitor, true, true);
|
||||
CodesJarM2CacheManager.updateCodesJarProject(monitor, true, true, true);
|
||||
System.setProperty("ignore.ci.mode", Boolean.FALSE.toString());
|
||||
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
@@ -981,6 +976,8 @@ public class AggregatorPomsHelper {
|
||||
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
|
||||
}
|
||||
}
|
||||
CodesJarResourceCache.getAllCodesJars().stream().filter(CodesJarInfo::isInCurrentMainProject)
|
||||
.forEach(info -> CodesJarM2CacheManager.updateCodesJarProjectPom(monitor, info));
|
||||
}
|
||||
|
||||
monitor.done();
|
||||
|
||||
@@ -97,6 +97,10 @@ public class ProcessorDependenciesManager {
|
||||
if (uniqueDependencies.contains(mavenUri)) {
|
||||
continue; // must be same GAV, avoid the different other attrs for modules
|
||||
}
|
||||
Object object = module.getExtraAttributes().get("ROUTINE_EXCLUDE");
|
||||
if (object != null && Boolean.valueOf(object.toString())) {
|
||||
continue;
|
||||
}
|
||||
uniqueDependencies.add(mavenUri);
|
||||
Dependency dependency = PomUtil.createModuleDependency(mavenUri);
|
||||
if (dependency != null) {
|
||||
|
||||
@@ -927,7 +927,6 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
|
||||
IMaven maven = MavenPlugin.getMaven();
|
||||
ArtifactRepository repository = maven.getLocalRepository();
|
||||
boolean isDIJob = ERepositoryObjectType.getItemType(getJobProcessor().getProperty().getItem()) == ERepositoryObjectType.PROCESS;
|
||||
for (Dependency dependency : duplicateDependencies) {
|
||||
if (((SortableDependency) dependency).isAssemblyOptional()) {
|
||||
continue;
|
||||
@@ -938,7 +937,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
sourceLocation = path.toString();
|
||||
|
||||
boolean latestVersionOrLowerVersionInChildJob = isLatestVersionOrLowerVersionInChildJob(parentJobDependencies, childJobDependencies, duplicateLibs, dependency);
|
||||
if (isDIJob && !latestVersionOrLowerVersionInChildJob && !new File(sourceLocation).exists()) {
|
||||
if (!latestVersionOrLowerVersionInChildJob && !new File(sourceLocation).exists()) {
|
||||
CommonExceptionHandler.warn("Job dependency [" + sourceLocation + "] does not exist!");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.designer.maven.utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -145,6 +146,23 @@ public class MavenProjectUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void addProjectClasspathEntry(IProgressMonitor monitor, IProject project, List<IClasspathEntry> entries) {
|
||||
try {
|
||||
Set<IClasspathEntry> classpathentries = new LinkedHashSet<IClasspathEntry>();
|
||||
IJavaProject javaProject = JavaCore.create(project);
|
||||
IClasspathEntry[] rawClasspathEntries = javaProject.getRawClasspath();
|
||||
for (IClasspathEntry entry : rawClasspathEntries) {
|
||||
classpathentries.add(entry);
|
||||
}
|
||||
classpathentries.addAll(entries);
|
||||
rawClasspathEntries = classpathentries.toArray(new IClasspathEntry[] {});
|
||||
javaProject.setRawClasspath(rawClasspathEntries, monitor);
|
||||
javaProject.setOutputLocation(project.getFolder(MavenSystemFolders.JAVA.getOutputPath()).getFullPath(), monitor);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear compliance settings from project, and set them into Eclipse compliance settings
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<properties>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
<log4j2.version>2.12.1</log4j2.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -502,10 +502,12 @@ public class ResumeUtil {
|
||||
// sun.security.action.GetPropertyAction("line.separator"));
|
||||
|
||||
private String lineSeparator = System.getProperty("line.separator");
|
||||
|
||||
private int capibility = 2<<14; //32k
|
||||
|
||||
public SimpleCsvWriter(FileChannel channel) {
|
||||
this.channel = channel;
|
||||
buf = ByteBuffer.allocate(2<<14);//32k buffer size
|
||||
buf = ByteBuffer.allocate(capibility);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -530,8 +532,15 @@ public class ResumeUtil {
|
||||
} else {// support double mode
|
||||
content = replace(content, "" + TextQualifier, "" + TextQualifier + TextQualifier);
|
||||
}
|
||||
|
||||
byte[] contentByte = content.getBytes();
|
||||
if(contentByte.length > capibility - 1024) {
|
||||
flush();
|
||||
capibility = contentByte.length * 2;
|
||||
buf = ByteBuffer.allocate(capibility);
|
||||
}
|
||||
|
||||
buf.put(content.getBytes());
|
||||
buf.put(contentByte);
|
||||
|
||||
buf.put(TextQualifier.getBytes());
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package routines.system;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
|
||||
import routines.TalendDate;
|
||||
@@ -31,6 +32,8 @@ public class RuntimeUtils {
|
||||
public static String getRuntimeType(Object o) {
|
||||
return o.getClass().getName();
|
||||
}
|
||||
|
||||
private static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
/**
|
||||
* This function is in order to check the Date type in tRunJob when transmit the context to child job.
|
||||
@@ -45,11 +48,40 @@ public class RuntimeUtils {
|
||||
|
||||
// when tRunJob transmit the date to child job, it should format with "yyyy-MM-dd HH:mm:ss"
|
||||
if (isDateType(o)) {
|
||||
return TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", (Date) o); //$NON-NLS-1$
|
||||
return TalendDate.formatDate(DEFAULT_DATE_PATTERN, (Date) o); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
public static Date getDate(String pattern, String dateString) {
|
||||
if (dateString == null || dateString.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// when tRunJob transmit the date to child job:
|
||||
//case 1: pass date string with pattern : yyyy-MM-dd HH:mm:ss
|
||||
//case 2: pass date long value
|
||||
//so here process two cases both and avoid exception
|
||||
try {
|
||||
return new java.text.SimpleDateFormat(pattern).parse(dateString);
|
||||
} catch(ParseException e) {
|
||||
//ignore exception
|
||||
}
|
||||
|
||||
try {
|
||||
return new Date(Long.valueOf(dateString));
|
||||
} catch(NumberFormatException e) {
|
||||
//ignore exception
|
||||
//System.err.println(String.format("Null value will be used for context parameter as can't parse this to date: %s", dateString));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Date getDate(String dateString) {
|
||||
return getDate(DEFAULT_DATE_PATTERN, dateString);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int i = 10;
|
||||
|
||||
@@ -69,7 +69,6 @@ import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
@@ -383,12 +382,18 @@ public class ModulesNeededProvider {
|
||||
}
|
||||
|
||||
public static void collectModuleNeeded(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList) {
|
||||
List<ModuleNeeded> importModuleFromExtension = ExtensionModuleManager.getInstance().getModuleNeededForComponent(context,
|
||||
importType);
|
||||
collectModuleNeeded(context, importType, importNeedsList, null);
|
||||
}
|
||||
|
||||
public static void collectModuleNeeded(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList, String distribution) {
|
||||
List<ModuleNeeded> importModuleFromExtension = ExtensionModuleManager.getInstance().getModuleNeededForComponent(context, importType);
|
||||
boolean foundModule = importModuleFromExtension.size() > 0;
|
||||
if (!foundModule) { // If cannot find the jar from extension point then do it like before.
|
||||
createModuleNeededForComponent(context, importType, importNeedsList);
|
||||
createModuleNeededForComponent(context, importType, importNeedsList, distribution);
|
||||
} else {
|
||||
if (!StringUtils.isEmpty(distribution)) {
|
||||
importModuleFromExtension.forEach(m -> m.setDynamicDistributionVersion(distribution));
|
||||
}
|
||||
importNeedsList.addAll(importModuleFromExtension);
|
||||
}
|
||||
}
|
||||
@@ -403,6 +408,10 @@ public class ModulesNeededProvider {
|
||||
}
|
||||
|
||||
public static void createModuleNeededForComponent(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList) {
|
||||
createModuleNeededForComponent(context, importType, importNeedsList, null);
|
||||
}
|
||||
|
||||
public static void createModuleNeededForComponent(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList, String distribution) {
|
||||
if (importType.getMODULE() == null) {
|
||||
if (importType.getMODULEGROUP() != null) {
|
||||
CommonExceptionHandler.warn("Missing module group definition: " + importType.getMODULEGROUP());
|
||||
@@ -421,6 +430,9 @@ public class ModulesNeededProvider {
|
||||
moduleNeeded.setMrRequired(importType.isMRREQUIRED());
|
||||
moduleNeeded.setShow(importType.isSHOW());
|
||||
moduleNeeded.setModuleLocaion(importType.getUrlPath());
|
||||
if (!StringUtils.isEmpty(distribution)) {
|
||||
moduleNeeded.setDynamicDistributionVersion(distribution);
|
||||
}
|
||||
importNeedsList.add(moduleNeeded);
|
||||
}
|
||||
|
||||
@@ -719,6 +731,7 @@ public class ModulesNeededProvider {
|
||||
if (!isRequired) {
|
||||
toAdd.getExtraAttributes().put("IS_OSGI_EXCLUDED", Boolean.TRUE);
|
||||
if ("RoutineItem".equals(item.eClass().getName())) {
|
||||
toAdd.getExtraAttributes().put("ROUTINE_EXCLUDE", Boolean.TRUE);
|
||||
toAdd.setExcluded(true);
|
||||
}
|
||||
}
|
||||
@@ -820,6 +833,8 @@ public class ModulesNeededProvider {
|
||||
IMPORTType importType = ComponentFactory.eINSTANCE.createIMPORTType();
|
||||
importType.setMODULEGROUP("esb-java-11-group");
|
||||
importType.setREQUIRED(true);
|
||||
|
||||
collectModuleNeeded("tRESTClient", importType, importNeedsListForRoutes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,8 +15,12 @@ package org.talend.librariesmanager.model.service;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
@@ -45,6 +49,17 @@ public class LibrariesIndexManager {
|
||||
|
||||
private static final String MAVEN_INDEX = "MavenUriIndex.xml";
|
||||
|
||||
private static final Set<String> EXCLUDED_INDEX_EXT = new HashSet<String>();
|
||||
|
||||
static {
|
||||
|
||||
EXCLUDED_INDEX_EXT.add(".javajet");
|
||||
EXCLUDED_INDEX_EXT.add(".xml");
|
||||
EXCLUDED_INDEX_EXT.add(".png");
|
||||
EXCLUDED_INDEX_EXT.add(".gif");
|
||||
EXCLUDED_INDEX_EXT.add(".properties");
|
||||
}
|
||||
|
||||
private LibrariesIndexManager() {
|
||||
loadIndexResources();
|
||||
}
|
||||
@@ -91,6 +106,9 @@ public class LibrariesIndexManager {
|
||||
}
|
||||
|
||||
public void saveStudioIndexResource() {
|
||||
Set<String> ignoredKeys = studioLibIndex.getJarsToRelativePath().stream().map(entry -> entry.getKey())
|
||||
.filter(k -> ingoredIndex(k)).collect(Collectors.toSet());
|
||||
ignoredKeys.forEach(k -> studioLibIndex.getJarsToRelativePath().removeKey(k));
|
||||
saveResource(studioLibIndex, LIBRARIES_INDEX);
|
||||
|
||||
}
|
||||
@@ -162,4 +180,13 @@ public class LibrariesIndexManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean ingoredIndex(String key) {
|
||||
for (String ext : EXCLUDED_INDEX_EXT) {
|
||||
if (StringUtils.endsWith(key, ext)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1253,6 +1253,10 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
|
||||
@Override
|
||||
public void createModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap) {
|
||||
buildModulesIndexFromComponentAndExtension(monitorWrap);
|
||||
}
|
||||
|
||||
public Map<String, String> buildModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap) {
|
||||
// key: moduleName, value: platformURL
|
||||
Map<String, String> platformURLMap = new HashMap<>();
|
||||
// key: moduleName, value: mvn uri
|
||||
@@ -1294,11 +1298,11 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
|
||||
saveMavenIndex(mavenURIMap, monitorWrap);
|
||||
savePlatfromURLIndex(platformURLMap, monitorWrap);
|
||||
|
||||
|
||||
if (service != null) {
|
||||
deployLibsFromCustomComponents(service, platformURLMap);
|
||||
}
|
||||
|
||||
return mavenURIMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,6 +45,11 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
ReplicaSets,
|
||||
ReplicaHost,
|
||||
ReplicaPort,
|
||||
|
||||
AuthenticationDatabase,
|
||||
UserPrincipal,
|
||||
Realm,
|
||||
KDCServer,
|
||||
|
||||
// Hadoop standard param
|
||||
NameNodeUri,
|
||||
@@ -84,6 +89,20 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
KeyAzuresUser,
|
||||
KeyAzurePassword,
|
||||
KeyAzureDeployBlob,
|
||||
|
||||
// Azure Synapse param
|
||||
SynapseHostName,
|
||||
SynapseAuthToken,
|
||||
SynapseSparkPools,
|
||||
SynapseFsHostName,
|
||||
SynapseFsContainer,
|
||||
SynapseFsUserName,
|
||||
SynapseFsPassword,
|
||||
SynapseDeployBlob,
|
||||
SynapseDriverMemory,
|
||||
SynapseDriverCores,
|
||||
SynapseExecutorMemory,
|
||||
UseTuningProperties,
|
||||
|
||||
// Hcatalog param
|
||||
HCatalogHostName,
|
||||
@@ -135,6 +154,7 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
|
||||
// DataBricks
|
||||
DataBricksEndpoint,
|
||||
DatabricksRunMode,
|
||||
DataBricksCloudProvider,
|
||||
DataBricksClusterId,
|
||||
DataBricksToken,
|
||||
|
||||
@@ -83,7 +83,6 @@ import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.metadata.managment.connection.manager.HiveConnectionManager;
|
||||
import org.talend.metadata.managment.hive.EmbeddedHiveDataBaseMetadata;
|
||||
import org.talend.metadata.managment.utils.MetadataConnectionUtils;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.utils.exceptions.MissingDriverException;
|
||||
import org.talend.utils.sql.ConnectionUtils;
|
||||
@@ -1453,10 +1452,6 @@ public class ExtractMetaDataUtils {
|
||||
if (StringUtils.isEmpty(defautVal)) {
|
||||
return;
|
||||
}
|
||||
if (defautVal.trim().equals("NULL")) {
|
||||
initialValue.setBody("");
|
||||
return;
|
||||
}
|
||||
defautVal = defautVal.trim();
|
||||
boolean defaultValueIsFunction = false;
|
||||
List<String> functions = getAllDBFuctions(dbMetaData);
|
||||
@@ -1474,12 +1469,45 @@ public class ExtractMetaDataUtils {
|
||||
defautVal = TalendQuoteUtils.addQuotes(defautVal, TalendQuoteUtils.SINGLE_QUOTE);
|
||||
}
|
||||
} else {
|
||||
defautVal = TalendQuoteUtils.addSingleQuotesIfNotExist(defautVal);
|
||||
defautVal = adaptForDBs(defautVal,dbMetaData);
|
||||
if(!defautVal.trim().equalsIgnoreCase("NULL")) {
|
||||
defautVal = TalendQuoteUtils.addSingleQuotesIfNotExist(defautVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
initialValue.setBody(defautVal);
|
||||
}
|
||||
|
||||
/*
|
||||
* add special code for different DBs as they may have special return value if set default NULL. (for now only add mysql/oracle/mssql , could add more later if customer requests)
|
||||
*/
|
||||
private String adaptForDBs(String defaultVal,DatabaseMetaData dbMetaData) {
|
||||
String dbType= "";
|
||||
try {
|
||||
String type = dbMetaData.getDatabaseProductName();
|
||||
if(type != null) {
|
||||
dbType = type;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
if(EDatabaseTypeName.MYSQL.getDisplayName().equalsIgnoreCase(dbType)) {
|
||||
if("NULL".equalsIgnoreCase(defaultVal)) {
|
||||
defaultVal = TalendQuoteUtils.addSingleQuotesIfNotExist(defaultVal);
|
||||
}
|
||||
}else if(EDatabaseTypeName.ORACLE_OCI.getProduct().equalsIgnoreCase(dbType)) {
|
||||
//oracle do nothing for now
|
||||
}else if(EDatabaseTypeName.MSSQL.getDisplayName().equalsIgnoreCase(dbType)) {
|
||||
defaultVal = removeBracketsIfExist(defaultVal);
|
||||
}
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
private String removeBracketsIfExist(String value) {
|
||||
if (StringUtils.isNotEmpty(value)&&value.startsWith("(") && value.endsWith(")")) {
|
||||
value= value.substring(1,value.length()-1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
public String getSchema() {
|
||||
return schema;
|
||||
}
|
||||
|
||||
@@ -70,9 +70,25 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
@Override
|
||||
public Connection call() throws Exception {
|
||||
Connection conn = null;
|
||||
|
||||
if( !("".equals( metadataConn.getPassword() ) || "\"\"".equals( metadataConn.getPassword() )) ) {
|
||||
String url = metadataConn.getUrl().replace(";auth=noSasl", "");
|
||||
|
||||
|
||||
if (url.startsWith("jdbc:hive2") && !url.contains(";user=")) {
|
||||
url = url + ";user=" + metadataConn.getUsername() + ";password=" + metadataConn.getPassword();
|
||||
} else if (!url.contains(";AuthMech=3;UID=")) {
|
||||
url = url + ";AuthMech=3;UID=" + metadataConn.getUsername() + ";PWD=" + metadataConn.getPassword();
|
||||
}
|
||||
|
||||
metadataConn.setUrl(url);
|
||||
}
|
||||
|
||||
|
||||
String connURL = metadataConn.getUrl();
|
||||
String username = metadataConn.getUsername();
|
||||
String password = metadataConn.getPassword();
|
||||
String password = metadataConn.getPassword();
|
||||
|
||||
// 1. Get class loader.
|
||||
ClassLoader currClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
ClassLoader impalaClassLoader = getClassLoader(metadataConn);
|
||||
@@ -147,8 +163,11 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
Properties info = new Properties();
|
||||
username = username != null ? username : ""; //$NON-NLS-1$
|
||||
password = password != null ? password : "";//$NON-NLS-1$
|
||||
info.setProperty("user", username);//$NON-NLS-1$
|
||||
info.setProperty("password", password);//$NON-NLS-1$
|
||||
|
||||
|
||||
// info.setProperty("user", username);//$NON-NLS-1$
|
||||
// info.setProperty("password", password);//$NON-NLS-1$
|
||||
|
||||
conn = hiveDriver.connect(connURL, info);
|
||||
} finally {
|
||||
Thread.currentThread().setContextClassLoader(currClassLoader);
|
||||
|
||||
@@ -4495,6 +4495,20 @@ public class DatabaseForm extends AbstractForm {
|
||||
};
|
||||
} else if (isImpalaDBConnSelected()) {
|
||||
final IMetadataConnection metadataConn = ConvertionHelper.convert(connectionItem.getConnection(), true);
|
||||
|
||||
if( !("".equals(metadataConn.getPassword()) || "\"\"".equals(metadataConn.getPassword())) ) {
|
||||
String url = metadataConn.getUrl().replace(";auth=noSasl", "");
|
||||
|
||||
if (url.startsWith("jdbc:hive2")) {
|
||||
url = url + ";user=" + metadataConn.getUsername() + ";password=" + metadataConn.getPassword();
|
||||
} else {
|
||||
url = url + ";AuthMech=3;UID=" + metadataConn.getUsername() + ";PWD=" + metadataConn.getPassword();
|
||||
}
|
||||
|
||||
metadataConn.setUrl(url);
|
||||
}
|
||||
|
||||
|
||||
checkingDialog = new AProgressMonitorDialogWithCancel<Boolean>(getShell()) {
|
||||
|
||||
@Override
|
||||
@@ -8695,7 +8709,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
hiveVersion == null ? null : hiveVersion.getVersion(), false);
|
||||
if (impalaDriverDisplay != null && impalaDriverDisplay.length == 0) {
|
||||
// hive2 by default
|
||||
impalaDriverCombo.getCombo().setItems(EImpalaDriver.HIVE2.getDisplayName());
|
||||
impalaDriverCombo.getCombo().setItems(EImpalaDriver.HIVE2.getDisplayName().split("\n"));
|
||||
} else {
|
||||
impalaDriverCombo.getCombo().setItems(impalaDriverDisplay);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.repository.viewer.ui.provider;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
@@ -24,6 +25,7 @@ import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerSorter;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.utils.RepositoryManagerHelper;
|
||||
import org.talend.core.repository.model.ProjectRepositoryNode;
|
||||
@@ -31,6 +33,7 @@ import org.talend.core.repository.ui.utils.RecombineRepositoryNodeUtil;
|
||||
import org.talend.core.repository.ui.view.RepositoryLabelProvider;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryService;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.model.nodes.IProjectRepositoryNode;
|
||||
import org.talend.repository.navigator.RepoViewCommonNavigator;
|
||||
@@ -107,6 +110,8 @@ public class RepositoryViewerProvider extends AbstractViewerProvider {
|
||||
sorter = viewer.getSorter();
|
||||
}
|
||||
final ViewerSorter viewerSorter = sorter;
|
||||
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRepositoryService.class);
|
||||
// TDI-20528
|
||||
// treeViewer.setSorter(sorter);
|
||||
treeViewer.setSorter(new TreePathViewerSorter() {
|
||||
@@ -127,7 +132,35 @@ public class RepositoryViewerProvider extends AbstractViewerProvider {
|
||||
// do special for simple folder,TDI-20528
|
||||
if (node1.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER
|
||||
|| node2.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
|
||||
return e1.toString().compareTo(e2.toString());
|
||||
int ret = e1.toString().compareTo(e2.toString());
|
||||
// TUP-33214:sort between leaf node and embedded folder node. should return positive integer
|
||||
// when leaf node is in prefix folder of folder node instead of comparing the string simply.
|
||||
if (node1.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
|
||||
IRepositoryNode parent = node1.getParent();
|
||||
if (parent != null && parent.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
|
||||
ret = 1;
|
||||
}
|
||||
if (parent != null && parent.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
|
||||
IPath path1 = service.getRepositoryPath(parent);
|
||||
IPath path2 = service.getRepositoryPath(node2);
|
||||
if (path1 != null && (path1.isPrefixOf(path2) || path1.equals(path2))) {
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
} else if (node2.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
|
||||
IRepositoryNode parent = node2.getParent();
|
||||
if (parent != null && parent.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
|
||||
ret = -1;
|
||||
}
|
||||
if (parent != null && parent.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
|
||||
IPath path2 = service.getRepositoryPath(parent);
|
||||
IPath path1 = service.getRepositoryPath(node1);
|
||||
if (path2 != null && (path2.equals(path1) || path2.isPrefixOf(path1))) {
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
} else if (viewerSorter != null) {
|
||||
if (viewerSorter instanceof TreePathViewerSorter) {
|
||||
if (!node1.isInitialized() && !node2.isInitialized()) {
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.utils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
@@ -247,4 +249,25 @@ public class TalendQuoteUtilsTest {
|
||||
assertTrue("\"abcd\"".equals(resultStr));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsStartEndsWithQuotation() {
|
||||
String text = "\"prefix_\"+context.db+\".\"+context.schema+\"_suffix\"";
|
||||
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, false));
|
||||
|
||||
text = "\"prefix_\"+context.db+\".\"+context.schema";
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
|
||||
|
||||
text = "context.db+\".\"+context.schema+\"_suffix\"";
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
|
||||
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
|
||||
|
||||
text = "context.db+\".\"+context.schema";
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
|
||||
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,14 +37,14 @@ public class CreateMavenJobPomTest {
|
||||
@Test
|
||||
public void testNormalizeSpaces() throws Exception {
|
||||
String inputSh = "#!/bin/sh\n" + "cd `dirname $0`\n" + "ROOT_PATH=`pwd`\n"
|
||||
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.12.1.jar:$ROOT_PATH/../lib/log4j-api-2.12.1.jar:$ROOT_PATH/../lib/log4j-core-2.12.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
|
||||
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.17.1.jar:$ROOT_PATH/../lib/log4j-api-2.17.1.jar:$ROOT_PATH/../lib/log4j-core-2.17.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
|
||||
String expectSh = "#!/bin/sh\n" + "cd `dirname $0`\n" + "ROOT_PATH=`pwd`\n"
|
||||
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.12.1.jar:$ROOT_PATH/../lib/log4j-api-2.12.1.jar:$ROOT_PATH/../lib/log4j-core-2.12.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
|
||||
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.17.1.jar:$ROOT_PATH/../lib/log4j-api-2.17.1.jar:$ROOT_PATH/../lib/log4j-core-2.17.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
|
||||
|
||||
String inputBat = "%~d0\n" + "cd %~dp0\n"
|
||||
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.12.1.jar;../lib/log4j-api-2.12.1.jar;../lib/log4j-core-2.12.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
|
||||
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.17.1.jar;../lib/log4j-api-2.17.1.jar;../lib/log4j-core-2.17.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
|
||||
String expectBat = "%~d0\n" + "cd %~dp0\n"
|
||||
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.12.1.jar;../lib/log4j-api-2.12.1.jar;../lib/log4j-core-2.12.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
|
||||
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.17.1.jar;../lib/log4j-api-2.17.1.jar;../lib/log4j-core-2.17.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
|
||||
|
||||
String actualSh = CreateMavenJobPom.normalizeSpaces(inputSh);
|
||||
assertEquals(expectSh, actualSh);
|
||||
|
||||
@@ -7,6 +7,7 @@ import static org.junit.Assert.*;
|
||||
import static org.mockito.Matchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.ResultSet;
|
||||
@@ -15,6 +16,17 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.notify.Adapter;
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.TreeIterator;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EOperation;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
import org.eclipse.emf.ecore.EStructuralFeature;
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -31,7 +43,10 @@ import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import orgomg.cwm.objectmodel.core.CoreFactory;
|
||||
import orgomg.cwm.objectmodel.core.CorePackage;
|
||||
import orgomg.cwm.objectmodel.core.Expression;
|
||||
import orgomg.cwm.objectmodel.core.impl.ExpressionImpl;
|
||||
|
||||
/**
|
||||
* @author zshen
|
||||
@@ -804,6 +819,126 @@ public class ExtractMetaDataUtilsTest {
|
||||
verify(initialValue, times(2)).setBody(initialValue.getBody());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHandleDefaultValueWhenOracleNULL() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("NULL");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "NULL");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueWhenOraclenull() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("null");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "null");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueOracleNullWithQuotes() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("'NULL'");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "'NULL'");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueOracleCommon() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("abc");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "'abc'");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueWhenMysqlNULL() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("MySQL");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody(null);
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), null);
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueMysqlNullWithQuotes() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("MySQL");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("NULL");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "'NULL'");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueMysqlCommon() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("MySQL");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("abc");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "'abc'");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueWhenMssqlNULL() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("Microsoft SQL Server");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("(NULL)");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "NULL");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueMssqlNullWithQuotes() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("Microsoft SQL Server");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("('NULL')");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "'NULL'");
|
||||
}
|
||||
@Test
|
||||
public void testHandleDefaultValueMssqlCommon() throws SQLException {
|
||||
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
|
||||
when(dbMetadata.getDatabaseProductName()).thenReturn("Microsoft SQL Server");
|
||||
MetadataColumn metadataColumn = mock(MetadataColumn.class);
|
||||
when(metadataColumn.getTalendType()).thenReturn("id_String");
|
||||
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
|
||||
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
|
||||
initialValue.setBody("abc");
|
||||
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
|
||||
Assert.assertEquals(initialValue.getBody(), "'abc'");
|
||||
}
|
||||
@Test
|
||||
public void testGetMultiSchems() {
|
||||
// null
|
||||
|
||||
Reference in New Issue
Block a user