Skip to content

Commit

Permalink
Bump version of essential-json to get the byte arrays accessors; acce…
Browse files Browse the repository at this point in the history
…pt the 'T' as date/time separator
  • Loading branch information
arkanovicz committed Sep 27, 2022
1 parent 52c6c60 commit 091cc58
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions modality-api-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>com.republicate.modality</groupId>
<artifactId>modality</artifactId>
<version>2.1.4</version>
<version>2.2</version>
</parent>

<artifactId>modality-api-client</artifactId>
Expand Down Expand Up @@ -50,7 +50,7 @@ under the License.
<dependency>
<groupId>com.republicate</groupId>
<artifactId>essential-json</artifactId>
<version>2.6.4</version>
<version>2.7</version>
</dependency>
<!-- force version of commons-codec
to avoid a security issue in v1.11
Expand Down
4 changes: 2 additions & 2 deletions modality-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.republicate.modality</groupId>
<artifactId>modality</artifactId>
<version>2.1.4</version>
<version>2.2</version>
</parent>

<artifactId>modality-core</artifactId>
Expand Down Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>com.republicate</groupId>
<artifactId>essential-json</artifactId>
<version>2.6.4</version>
<version>2.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public static List<String> getColumnNames(ResultSet resultSet) throws SQLExcepti
sqlTypeToClass.put(Types.TIMESTAMP, java.sql.Timestamp.class);
sqlTypeToClass.put(Types.TINYINT, Byte.class);
sqlTypeToClass.put(Types.VARCHAR, String.class);
sqlTypeToClass.put(Types.BINARY, byte[].class);
}

public static Class getSqlTypeClass(int type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public class ConversionHandlerImpl implements ConversionHandler

static DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd");
static DateFormat isoTimestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
static DateFormat isoSepTimestampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

/**
* a converters cache map, initialized with the standard narrowing and string parsing conversions.
Expand Down Expand Up @@ -677,7 +678,9 @@ public java.sql.Timestamp convert(Serializable o)
{
try
{
return new java.sql.Timestamp(isoTimestampFormat.parse(String.valueOf(o)).getTime());
String strTime = String.valueOf(o);
DateFormat format = strTime.contains("T") ? isoSepTimestampFormat : isoTimestampFormat;
return new java.sql.Timestamp(format.parse(strTime).getTime());
}
catch (ParseException pe)
{
Expand Down
2 changes: 1 addition & 1 deletion modality-examples/modality-example-bookshelf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>com.republicate.modality</groupId>
<artifactId>modality-examples</artifactId>
<version>2.1.4</version>
<version>2.2</version>
</parent>

<artifactId>modality-example-bookshelf</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modality-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>com.republicate.modality</groupId>
<artifactId>modality</artifactId>
<version>2.1.4</version>
<version>2.2</version>
</parent>

<artifactId>modality-examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modality-webapp-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>com.republicate.modality</groupId>
<artifactId>modality</artifactId>
<version>2.1.4</version>
<version>2.2</version>
</parent>

<artifactId>modality-webapp-auth</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modality-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>com.republicate.modality</groupId>
<artifactId>modality</artifactId>
<version>2.1.4</version>
<version>2.2</version>
</parent>

<artifactId>modality-webapp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ under the License.

<groupId>com.republicate.modality</groupId>
<artifactId>modality</artifactId>
<version>2.1.4</version>
<version>2.2</version>

<packaging>pom</packaging>
<name>${project.groupId}:${project.artifactId}</name>
Expand Down
2 changes: 1 addition & 1 deletion velocity-tools-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<groupId>com.republicate.modality</groupId>
<artifactId>modality</artifactId>

<version>2.1.4</version>
<version>2.2</version>
</parent>

<artifactId>velocity-tools-model</artifactId>
Expand Down

0 comments on commit 091cc58

Please sign in to comment.