From 8c6b968190c4cbe35896e2c817b47d509928d5ff Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Fri, 23 Jan 2015 19:56:22 +0000 Subject: [PATCH] OPENJPA-2558 add getRepresentation to allow BooleanRepresentation be used in SQLBuffer git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1654352 13f79535-47bb-0310-9956-ffa450edef68 --- .../jdbc/sql/BooleanRepresentation.java | 228 +----------------- .../sql/BooleanRepresentationFactory.java | 214 ++++++++++++++++ .../apache/openjpa/jdbc/sql/DBDictionary.java | 8 +- .../openjpa/jdbc/sql/PostgresDictionary.java | 2 +- .../apache/openjpa/jdbc/sql/SQLBuffer.java | 2 +- .../jdbc/sql/TestBooleanRepresentation.java | 12 +- .../src/doc/manual/ref_guide_dbsetup.xml | 8 - 7 files changed, 239 insertions(+), 235 deletions(-) create mode 100644 openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.java diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentation.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentation.java index 66e58c70f..987fc9088 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentation.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/BooleanRepresentation.java @@ -21,10 +21,6 @@ package org.apache.openjpa.jdbc.sql; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.Arrays; - -import org.apache.openjpa.lib.util.Localizer; -import org.apache.openjpa.util.UserException; /** *

Defines how a {@code Boolean} or {@code boolean} value @@ -36,8 +32,7 @@ import org.apache.openjpa.util.UserException; * However, sometimes you like to use a different default representation for Boolean values in your database. * If your application likes to store boolean values in a {@code CHAR(1)} field with {@code "T"} and * {@code "F"} values then you might configure the {@link org.apache.openjpa.jdbc.sql.DBDictionary} - * to use the {@link org.apache.openjpa.jdbc.sql.BooleanRepresentation.BooleanRepresentations#STRING_TF} - * BooleanRepresentation: + * to use the {@code "STRING_TF"} BooleanRepresentation: *

  * <property name="openjpa.jdbc.DBDictionary"
  *     value="(BitTypeName=CHAR(1),BooleanTypeName=CHAR(1),BooleanRepresentation=STRING_10)"/>
@@ -50,7 +45,8 @@ import org.apache.openjpa.util.UserException;
  *
  * 

The following {@code BooleanRepresentation} configuration options are possible: *