svn commit: r1872377 - in /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension: DockerCallbackMySQLExtension.java DockerCallbackPostgreSQLExtension.java

2020-01-06 Thread tv
Author: tv
Date: Mon Jan  6 13:29:47 2020
New Revision: 1872377

URL: http://svn.apache.org/viewvc?rev=1872377=rev
Log:
Add missing license header

Modified:

db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackMySQLExtension.java

db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java

Modified: 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackMySQLExtension.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackMySQLExtension.java?rev=1872377=1872376=1872377=diff
==
--- 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackMySQLExtension.java
 (original)
+++ 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackMySQLExtension.java
 Mon Jan  6 13:29:47 2020
@@ -1,5 +1,23 @@
 package org.apache.torque.testcontainer.junit5.extension;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 
 import static 
org.junit.jupiter.api.extension.ConditionEvaluationResult.enabled;
 

Modified: 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java?rev=1872377=1872376=1872377=diff
==
--- 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java
 (original)
+++ 
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java
 Mon Jan  6 13:29:47 2020
@@ -1,5 +1,23 @@
 package org.apache.torque.testcontainer.junit5.extension;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 
 import static 
org.junit.jupiter.api.extension.ConditionEvaluationResult.enabled;
 



-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



svn commit: r1872378 - in /db/torque/torque4/trunk/torque-templates/src: main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java test/resources/org/apache/torque/templates/expected-sche

2020-01-06 Thread tv
Author: tv
Date: Mon Jan  6 13:31:04 2020
New Revision: 1872378

URL: http://svn.apache.org/viewvc?rev=1872378=rev
Log:
Fix scale handling (caused syntax error in generated Oracle SQL), fix type 
mapping

Modified:

db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java

db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql

Modified: 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java?rev=1872378=1872377=1872378=diff
==
--- 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
 (original)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java
 Mon Jan  6 13:31:04 2020
@@ -81,7 +81,7 @@ public class PlatformOracleImpl extends
 new SqlType("NUMBER"));
 setSchemaTypeToSqlTypeMapping(
 SchemaType.DOUBLE,
-new SqlType("FLOAT"));
+new SqlType("NUMBER"));
 setSchemaTypeToSqlTypeMapping(
 SchemaType.DECIMAL,
 new SqlType("NUMBER"));
@@ -185,4 +185,13 @@ public class PlatformOracleImpl extends
 {
 return !("BLOB".equals(sqlType) || "CLOB".equals(sqlType));
 }
+
+/**
+ * @see Platform#hasScale(String)
+ */
+@Override
+public boolean hasScale(String sqlType)
+{
+return "TIMESTAMP".equals(sqlType) || "NUMBER".equals(sqlType);
+}
 }

Modified: 
db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql?rev=1872378=1872377=1872378=diff
==
--- 
db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql
 (original)
+++ 
db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql
 Mon Jan  6 13:31:04 2020
@@ -88,7 +88,7 @@ DROP SEQUENCE torque.qualified_name_SEQ;
 -- ---
 CREATE TABLE a
 (
-a_id NUMBER(10,0)(0) NOT NULL,
+a_id NUMBER(10,0) NOT NULL,
 name VARCHAR2(50 CHAR) default 'a_name' NOT NULL,
 contactdata VARCHAR2(500 CHAR) NOT NULL,
 created_at TIMESTAMP(6) default CURRENT_TIMESTAMP NOT NULL,
@@ -110,7 +110,7 @@ CREATE SEQUENCE a_SEQ INCREMENT BY 1 STA
 -- ---
 CREATE TABLE b
 (
-b_id NUMBER(10,0)(0) NOT NULL,
+b_id NUMBER(10,0) NOT NULL,
 name VARCHAR2(50 CHAR) NOT NULL,
 CONSTRAINT NAME_UNQ UNIQUE (name)
 );
@@ -128,8 +128,8 @@ CREATE SEQUENCE b_SEQ INCREMENT BY 1 STA
 -- ---
 CREATE TABLE b2
 (
-b2_id NUMBER(10,0)(0) NOT NULL,
-b2_id_2 NUMBER(10,0)(0),
+b2_id NUMBER(10,0) NOT NULL,
+b2_id_2 NUMBER(10,0),
 b2_name_1 VARCHAR2(50 CHAR) NOT NULL,
 b2_name_2 VARCHAR2(20 CHAR) NOT NULL,
 b2_name_3 VARCHAR2(10 CHAR) NOT NULL,
@@ -150,8 +150,8 @@ CREATE SEQUENCE b2_SEQ INCREMENT BY 1 ST
 -- ---
 CREATE TABLE r_ab
 (
-a_id NUMBER(10,0)(0) NOT NULL,
-b_id NUMBER(10,0)(0) NOT NULL,
+a_id NUMBER(10,0) NOT NULL,
+b_id NUMBER(10,0) NOT NULL,
 name VARCHAR2(50 CHAR) NOT NULL
 );
 
@@ -167,9 +167,9 @@ ALTER TABLE r_ab
 -- ---
 CREATE TABLE c
 (
-c_id NUMBER(10,0)(0) NOT NULL,
-a_id NUMBER(10,0)(0) NOT NULL,
-b_id NUMBER(10,0)(0) NOT NULL,
+c_id NUMBER(10,0) NOT NULL,
+a_id NUMBER(10,0) NOT NULL,
+b_id NUMBER(10,0) NOT NULL,
 name VARCHAR2(50 CHAR) NOT NULL
 );
 
@@ -186,10 +186,10 @@ CREATE SEQUENCE c_SEQ INCREMENT BY 1 STA
 -- ---
 CREATE TABLE d
 (
-d_id NUMBER(10,0)(0) NOT NULL,
+d_id NUMBER(10,0) NOT NULL,
 name VARCHAR2(255 CHAR) NOT NULL,
-b_id NUMBER(10,0)(0) NOT NULL,
-a_id NUMBER(10,0)(0) NOT NULL
+b_id NUMBER(10,0) NOT NULL,
+a_id NUMBER(10,0) NOT NULL
 );
 
 ALTER TABLE d
@@ -204,7 +204,7 @@ ALTER TABLE d
 -- ---
 CREATE TABLE nopk
 (
-intcol NUMBER(10,0)(0),
+intcol NUMBER(10,0),
 name VARCHAR2(50 CHAR)
 );
 
@@ 

svn commit: r1872379 - /db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/

2020-01-06 Thread tv
Author: tv
Date: Mon Jan  6 13:45:27 2020
New Revision: 1872379

URL: http://svn.apache.org/viewvc?rev=1872379=rev
Log:
Refactor time/date/timestamp-string formatting

Modified:

db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java

db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDerbyImpl.java

db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java

db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMssqlImpl.java

db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java

db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformOracleImpl.java

Modified: 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java?rev=1872379=1872378=1872379=diff
==
--- 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java
 (original)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java
 Mon Jan  6 13:45:27 2020
@@ -19,12 +19,12 @@ package org.apache.torque.templates.plat
  * under the License.
  */
 
-import java.text.SimpleDateFormat;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.TimeZone;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.torque.templates.typemapping.SchemaType;
@@ -95,6 +95,20 @@ public class PlatformDefaultImpl impleme
 }
 schemaTypeToSqlTypeMap.put(schemaType, sqlType);
 }
+
+/**
+ * Helper function to format date values to a platform-specific string
+ * 
+ * @param date the Date object
+ * @param format the format string
+ * @return the formatted string
+ */
+protected String formatDateTimeString(Date date, String format)
+{
+return DateTimeFormatter.ofPattern(format)
+.format(date.toInstant()
+.atZone(ZoneId.of("GMT")));
+}
 
 /**
  * @see Platform#getSqlTypeForSchemaType(SchemaType)
@@ -218,9 +232,7 @@ public class PlatformDefaultImpl impleme
 @Override
 public String getTimestampString(Date date)
 {
-SimpleDateFormat dateFormat = new SimpleDateFormat(TIMESTAMP_FORMAT);
-dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
-return dateFormat.format(date);
+return formatDateTimeString(date, TIMESTAMP_FORMAT);
 }
 
 /**

Modified: 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDerbyImpl.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDerbyImpl.java?rev=1872379=1872378=1872379=diff
==
--- 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDerbyImpl.java
 (original)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDerbyImpl.java
 Mon Jan  6 13:45:27 2020
@@ -67,7 +67,7 @@ public class PlatformDerbyImpl extends P
 new SqlType("SMALLINT"));
 }
 
-/* (non-Javadoc)
+/**
  * @see 
org.apache.torque.templates.platform.PlatformDefaultImpl#getAutoIncrement()
  */
 @Override
@@ -76,7 +76,7 @@ public class PlatformDerbyImpl extends P
 return "GENERATED BY DEFAULT AS IDENTITY";
 }
 
-/* (non-Javadoc)
+/**
  * @see 
org.apache.torque.templates.platform.PlatformDefaultImpl#hasScale(java.lang.String)
  */
 @Override
@@ -85,7 +85,7 @@ public class PlatformDerbyImpl extends P
 return "NUMERIC".equals(sqlType) || "DECIMAL".equals(sqlType);
 }
 
-/* (non-Javadoc)
+/**
  * @see 
org.apache.torque.templates.platform.PlatformDefaultImpl#hasSize(java.lang.String)
  */
 @Override

Modified: 
db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java?rev=1872379=1872378=1872379=diff
==
--- 

Jenkins build is back to normal : Torque4-trunk ยป Torque Maven Parent #669

2020-01-06 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



Jenkins build is back to normal : Torque4-trunk #669

2020-01-06 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org