From 7db9a7fae5397c99d72efb63b018436a0294a151 Mon Sep 17 00:00:00 2001 From: "David J. Wisneski" Date: Fri, 29 Jun 2007 21:22:01 +0000 Subject: [PATCH] OPENJPA-266, committing the patch. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@552039 13f79535-47bb-0310-9956-ffa450edef68 --- .../jdbc/kernel/AbstractUpdateManager.java | 4 ++-- .../kernel/PreparedStatementManagerImpl.java | 2 +- .../openjpa/jdbc/sql/OracleDictionary.java | 4 ++-- .../apache/openjpa/jdbc/sql/SelectImpl.java | 20 +++++++++++-------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractUpdateManager.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractUpdateManager.java index d52d5eb24..1b5614230 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractUpdateManager.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractUpdateManager.java @@ -136,7 +136,7 @@ public abstract class AbstractUpdateManager * @param customs buffer custom mappings * @return the exceptions list */ - private Collection populateRowManager(OpenJPAStateManager sm, + protected Collection populateRowManager(OpenJPAStateManager sm, RowManager rowMgr, JDBCStore store, Collection exceps, Collection customs) { try { @@ -336,7 +336,7 @@ public abstract class AbstractUpdateManager /** * Executes customized mapping updates. */ - private static class CustomMapping { + protected static class CustomMapping { public static final int INSERT = 0; public static final int UPDATE = 1; diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java index 8ef20582a..436237de6 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java @@ -79,7 +79,7 @@ public class PreparedStatementManagerImpl /** * Flush the given row. */ - private void flushInternal(RowImpl row) throws SQLException { + protected void flushInternal(RowImpl row) throws SQLException { // can't batch rows with auto-inc columns Column[] autoAssign = null; if (row.getAction() == Row.ACTION_INSERT) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java index e89adcac1..32a758e75 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java @@ -912,7 +912,7 @@ public class OracleDictionary /** * Returns a OpenJPA 3-compatible name for an auto-assign sequence. */ - private String getOpenJPA3GeneratedKeySequenceName(Column col) { + protected String getOpenJPA3GeneratedKeySequenceName(Column col) { Table table = col.getTable(); return makeNameValid("SEQ_" + table.getName(), table.getSchema(). getSchemaGroup(), maxTableNameLength, NAME_ANY); @@ -921,7 +921,7 @@ public class OracleDictionary /** * Returns a OpenJPA 3-compatible name for an auto-assign trigger. */ - private String getOpenJPA3GeneratedKeyTriggerName(Column col) { + protected String getOpenJPA3GeneratedKeyTriggerName(Column col) { Table table = col.getTable(); return makeNameValid("TRIG_" + table.getName(), table.getSchema(). getSchemaGroup(), maxTableNameLength, NAME_ANY); diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java index 67a03a3a4..9fcc9e0f2 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java @@ -122,7 +122,7 @@ public class SelectImpl private SortedMap _tables = null; // combined list of selected ids and map of each id to its alias - private final Selects _selects = new Selects(); + protected final Selects _selects = newSelects(); private List _ordered = null; // flags @@ -158,7 +158,7 @@ public class SelectImpl // from select if this select selects from a tmp table created by another private SelectImpl _from = null; - private SelectImpl _outer = null; + protected SelectImpl _outer = null; // bitSet indicating if an alias is removed from parent select // bit 0 : correspond to alias 0 @@ -2670,20 +2670,24 @@ public class SelectImpl return super.toString() + " (" + _outer + "): " + _joins; } } + + protected Selects newSelects() { + return new Selects(); + } /** * Helper class to track selected columns, with fast contains method. * Acts as a list of select ids, with additional methods to manipulate * the alias of each selected id. */ - private static class Selects + protected static class Selects extends AbstractList { - private List _ids = null; - private List _idents = null; - private Map _aliases = null; - private Map _selectAs = null; - private DBDictionary _dict = null; + protected List _ids = null; + protected List _idents = null; + protected Map _aliases = null; + protected Map _selectAs = null; + protected DBDictionary _dict = null; /** * Add all aliases from another instance.