You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by dw...@apache.org on 2009/05/26 16:52:14 UTC

svn commit: r778727 - in /openjpa/branches/1.3.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/

Author: dwoods
Date: Tue May 26 14:52:13 2009
New Revision: 778727

URL: http://svn.apache.org/viewvc?rev=778727&view=rev
Log:
OPENJPA-946 - Oracle create table(s) exceptions.  Also includes required code from OPENJPA-866 - DBDictionary.maxTableNameLength is not checked when using SynchronizeMappings.  Both patches contributed by Tim McConnell.

Added:
    openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/
    openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/EntityReservedWords.java   (with props)
Modified:
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DynamicSchemaFactory.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Schema.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
    openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DynamicSchemaFactory.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DynamicSchemaFactory.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DynamicSchemaFactory.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DynamicSchemaFactory.java Tue May 26 14:52:13 2009
@@ -90,6 +90,13 @@
         Schema schema = getSchema(schemaName);
         if (schema == null)
             schema = addSchema(schemaName);
+
+        // Ensure only valid table name(s) are added to the schema
+        if (tableName.length() > _dict.maxTableNameLength) {
+            return schema.addTable(tableName, 
+                _dict.getValidTableName(tableName, getSchema(schemaName)));
+        }
+
         return schema.addTable(tableName);
     }
 
@@ -104,7 +111,7 @@
     /**
      * Table type that adds columns when {@link #getColumn} is called.
      */
-    private static class DynamicTable
+    private class DynamicTable
         extends Table {
 
         public DynamicTable(String name, Schema schema) {
@@ -118,6 +125,14 @@
             Column col = super.getColumn(name);
             if (col != null)
                 return col;
+
+            // Ensure only valid column name(s) are added to the table
+            if ((name.length() > _dict.maxColumnNameLength) ||
+                _dict.getInvalidColumnWordSet().contains(name.toUpperCase())) {
+                return addColumn(name, 
+                    _dict.getValidColumnName(name, this));
+            }
+
             return addColumn(name);
         }
     }

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java Tue May 26 14:52:13 2009
@@ -39,13 +39,17 @@
 
     private Set _names = null;
 
+    // an additional names Set for checking name duplication
+    private Set _subNames = null;
+
     /**
      * Return true if the given name is in use already.
      */
     public boolean isNameTaken(String name) {
         if (name == null)
             return true;
-        return _names != null && _names.contains(name.toUpperCase());
+        return (_names != null && _names.contains(name.toUpperCase())) ||
+            (_subNames != null && _subNames.contains(name.toUpperCase()));
     }
 
     /**
@@ -77,4 +81,20 @@
         if (name != null && _names != null)
             _names.remove(name.toUpperCase());
     }
+
+    /**
+    * Attempt to add the given name to the set.
+    *
+    * @param name the name to add
+    */
+    protected void addSubName(String name) {
+        if (_subNames == null) {
+            _subNames = new HashSet();
+        }
+        _subNames.add(name.toUpperCase());
+    }
+
+    protected void resetSubNames() {
+        _subNames = null;
+    }
 }

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Schema.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Schema.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Schema.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Schema.java Tue May 26 14:52:13 2009
@@ -134,6 +134,24 @@
     }
 
     /**
+     * Add a table with a shortened (i.e., validated) name to the schema
+     */
+    public Table addTable(String name, String validName) {
+        SchemaGroup group = getSchemaGroup();
+        Table tab;
+        if (group != null) {
+            group.addName(validName, true);
+            tab = group.newTable(validName, this);
+        } else
+            tab = new Table(validName, this);
+        if (_tableMap == null)
+            _tableMap = new TreeMap();
+        _tableMap.put(name.toUpperCase(), tab);
+        _tables = null;
+        return tab;
+    }
+
+    /**
      * Remove the given table from the schema.
      *
      * @return true if the table was removed, false if not in the schema

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java Tue May 26 14:52:13 2009
@@ -297,6 +297,26 @@
         return col;
     }
 
+
+    /**
+     * Add a colum with a shortened (i.e., validated) name to the table
+     */
+    public Column addColumn(String name, String validName) {
+        addName(name, true);
+        Schema schema = getSchema();
+        Column col;
+        if (schema != null && schema.getSchemaGroup() != null)
+            col = schema.getSchemaGroup().newColumn(validName, this);
+        else
+            col = new Column(validName, this);
+        if (_colMap == null)
+            _colMap = new LinkedHashMap();
+        _colMap.put(name.toUpperCase(), col);
+        _cols = null;
+        return col;
+    }
+
+
     /**
      * Remove the given column from the table.
      *
@@ -736,4 +756,15 @@
     public void setColNumber(int colNum) {
         _colNum = colNum;
     }
+
+    /**
+    * Add a column to the subNames set to avoid naming conflict.
+    */
+    public void addSubColumn(String name) {
+        addSubName(name);
+    }
+
+    public void resetSubColumns() {
+        resetSubNames();
+    }
 }

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java Tue May 26 14:52:13 2009
@@ -150,6 +150,11 @@
             "TYPE", "UNDO", "UNTIL", "VALIDPROC", "VARIABLE", "VARIANT", "VCAT",
             "VOLUMES", "WHILE", "WLM", "YEARS",
         }));
+        // reservedWordSet subset that can be used as valid column names
+        validColumnWordSet.addAll(Arrays.asList(new String[]{
+            "C", "COUNT", "DATE", "DATA", "LABEL", "LOCALE", "NAME", "NUMBER", 
+            "TIMESTAMP", "VALUE", 
+        }));
         
         super.setBatchLimit(defaultBatchLimit);
         

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Tue May 26 14:52:13 2009
@@ -340,6 +340,10 @@
     protected boolean connected = false;
     protected boolean isJDBC3 = false;
     protected final Set reservedWordSet = new HashSet();
+    // reservedWordSet subset that can be used as valid column names
+    protected Set<String> validColumnWordSet = new HashSet<String>();
+    // reservedWordSet subset that cannot be used as valid column names
+    protected Set<String> invalidColumnWordSet = new HashSet<String>();
     protected final Set systemSchemaSet = new HashSet();
     protected final Set systemTableSet = new HashSet();
     protected final Set fixedSizeTypeNameSet = new HashSet();
@@ -2900,6 +2904,18 @@
     }
 
     /**
+     * Return the subset of the words in reservedWordSet that cannot be used
+     * as valid column names for the current DB. If the column name is invalid
+     * the getValidColumnName method of the DB dictionary should be invoked to
+     * make it valid. 
+     *  
+     * @see getValidColumnName
+     */
+    public final Set<String> getInvalidColumnWordSet() {
+        return invalidColumnWordSet;
+    }
+
+    /**
      * Make any necessary changes to the given column name to make it valid
      * for the current DB.  The column name will be made unique for the
      * specified table.
@@ -4117,6 +4133,10 @@
             reservedWordSet.addAll(Arrays.asList(Strings.split
                 (reservedWords.toUpperCase(), ",", 0)));
 
+        // reservedWordSet subset that cannot be used as valid column names
+        invalidColumnWordSet = new HashSet(reservedWordSet);
+        invalidColumnWordSet.removeAll(validColumnWordSet);
+
         // add system schemas set by user
         if (systemSchemas != null)
             systemSchemaSet.addAll(Arrays.asList(Strings.split

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java Tue May 26 14:52:13 2009
@@ -77,6 +77,11 @@
             "RUNTIMESTATISTICS", "STATEMENT", "STATISTICS",
             "TIMING", "WAIT", "XML",
         }));
+        // reservedWordSet subset that can be used as valid column names
+        validColumnWordSet.addAll(Arrays.asList(new String[]{
+            "C", "COUNT", "DATE", "DATA", "NAME", "NUMBER", "NULLABLE", 
+            "TIMESTAMP", "TYPE", "VALUE", 
+        }));
     }
 
     public void closeDataSource(DataSource dataSource) {

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java Tue May 26 14:52:13 2009
@@ -107,6 +107,11 @@
             "LOAD", "MEDIUMINT", "OPTION", "OUTFILE", "REPLACE",
             "SET", "STARTING", "TEXT", "UNSIGNED", "ZEROFILL",
         }));
+        // reservedWordSet subset that can be used as valid column names
+        validColumnWordSet.addAll(Arrays.asList(new String[]{
+            "C", "COUNT", "DATE", "DATA", "NAME", "NULLABLE", "NUMBER", 
+            "TIMESTAMP", "TYPE", "VALUE", 
+        }));
 
         // MySQL requires double-escape for strings
         searchStringEscape = "\\\\";

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Tue May 26 14:52:13 2009
@@ -162,6 +162,11 @@
             "LONG", "MAXEXTENTS", "MINUS", "MODE", "NOAUDIT", "NOCOMPRESS",
             "NOWAIT", "OFFLINE", "ONLINE", "PCTFREE", "ROW",
         }));
+        // reservedWordSet subset that can be used as valid column names
+        validColumnWordSet.addAll(Arrays.asList(new String[]{
+            "C", "COUNT", "DATA", "NAME", "NULLABLE", "STORE", "TIMESTAMP", 
+            "TYPE", "VALUE", "VERSION", 
+        }));
 
         substringFunctionName = "SUBSTR";
         super.setBatchLimit(defaultBatchLimit);

Modified: openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java?rev=778727&r1=778726&r2=778727&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java (original)
+++ openjpa/branches/1.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java Tue May 26 14:52:13 2009
@@ -163,6 +163,11 @@
             "RETRIEVE", "RETURNS", "RULE", "SETOF", "STDIN", "STDOUT",
             "STORE", "VACUUM", "VERBOSE", "VERSION",
         }));
+        // reservedWordSet subset that can be used as valid column names
+        validColumnWordSet.addAll(Arrays.asList(new String[]{
+            "C", "COUNT", "DATE", "DATA", "NAME", "NULLABLE", "NUMBER", "OID", 
+            "STORE", "TIMESTAMP", "TYPE", "VALUE", "VERSION", 
+        }));
     }
 
     public Date getDate(ResultSet rs, int column)

Added: openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/EntityReservedWords.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/EntityReservedWords.java?rev=778727&view=auto
==============================================================================
--- openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/EntityReservedWords.java (added)
+++ openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/EntityReservedWords.java Tue May 26 14:52:13 2009
@@ -0,0 +1,487 @@
+/*
+ * 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.
+ */
+package org.apache.openjpa.persistence.dynamicschema;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import java.math.BigDecimal;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Calendar;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+
+/**
+ * Entity using reserved words for column names 
+ * 
+ * @see sql-keywords.rscs
+ * @author Tim McConnell
+ * @since 2.0.0
+ */
+@Entity
+public class EntityReservedWords implements Serializable {
+
+    @Id
+    private int id;
+    private Integer add;
+    private int application;
+    private BigDecimal begin;
+    private BigInteger bigint;
+    private Calendar calendar;
+    private String character;
+    private Integer conditional;
+    private Date date;
+    private BigDecimal decimal;
+    private Time distinct;
+    private String exception;
+    private int each;
+    private String from;
+    private Integer file;
+    private String grant;
+    private BigDecimal global;
+    private String hour;
+    private String holdlock;
+    private BigInteger integer;
+    private int index;
+    private BigInteger join;
+    private String jar;
+    private Calendar key;
+    private Timestamp kill;
+    private Integer like;
+    private BigDecimal loop;
+    private int minute;
+    private Date merge;
+    private String number;
+    private Integer not;
+    private Date outer;
+    private String on;
+    private BigInteger primary;
+    private int purge;
+    private Integer quiesce;
+    private String quit;
+    private BigDecimal restrict;
+    private Time rename;
+    private String select;
+    private Integer savepoint;
+    private Time time;
+    private Timestamp timestamp;
+    private Calendar trigger;
+    private int update;
+    private String until;
+    private String varchar;
+    private Integer variable;
+    private Timestamp wait;
+    private BigDecimal where;
+    private BigInteger xml;
+    private int year;
+    private Integer years;
+    private Date zerofill;
+    private String zone; 
+
+    public EntityReservedWords() {
+    }
+
+    public int getId() {
+        return id;
+    }
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getAdd() {
+        return add;
+    }
+    public void setAdd(int add) {
+        this.add = add;
+    }
+
+    public int getApplication() {
+        return application;
+    }
+    public void setApplication(int application) {
+        this.application = application;
+    }
+
+    public BigDecimal getBegin() {
+        return begin;
+    }
+    public void setBegin(BigDecimal begin) {
+        this.begin = begin;
+    }
+
+    public BigInteger getBigint() {
+        return bigint;
+    }
+    public void setBigint(BigInteger bigint) {
+        this.bigint = bigint;
+    }
+
+    public Calendar getCalendar() {
+        return calendar;
+    }
+    public void setCalendar(int Calendar) {
+        this.calendar = calendar;
+    }
+
+    public String getCharacter() {
+        return character;
+    }
+    public void setCharacter(String character) {
+        this.character = character;
+    }
+
+    public int getConditional() {
+        return conditional;
+    }
+    public void setConditional(int conditional) {
+        this.conditional = conditional;
+    }
+
+    public Date getDate() {
+        return date;
+    }
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+    public BigDecimal getDecimal() {
+        return decimal;
+    }
+    public void setDecimal(BigDecimal decimal) {
+        this.decimal = decimal;
+    }
+
+    public Time getDistinct() {
+        return distinct;
+    }
+    public void setDistinct(Time distinct) {
+        this.distinct = distinct;
+    }
+
+    public String getException() {
+        return exception;
+    }
+    public void setException(String exception) {
+        this.exception = exception;
+    }
+
+    public int getEach() {
+        return each;
+    }
+    public void setEach(int each) {
+        this.each = each;
+    }
+
+    public String getFrom() {
+        return from;
+    }
+    public void setFrom(String from) {
+        this.from = from;
+    }
+
+    public int getFile() {
+        return file;
+    }
+    public void setFile(int file) {
+        this.file = file;
+    }
+
+    public String getGrant() {
+        return grant;
+    }
+    public void setGrant(String grant) {
+        this.grant = grant;
+    }
+
+    public BigDecimal getGlobal() {
+        return global;
+    }
+    public void setGlobal(BigDecimal global) {
+        this.global = global;
+    }
+
+    public String getHour() {
+        return hour;
+    }
+    public void setHour(String hour) {
+        this.hour = hour;
+    }
+
+    public String getHoldlock() {
+        return holdlock;
+    }
+    public void setHoldlock(String holdlock) {
+        this.holdlock = holdlock;
+    }
+
+    public BigInteger getInteger() {
+        return integer;
+    }
+    public void setInteger(BigInteger integer) {
+        this.integer = integer;
+    }
+
+    public int getIndex() {
+        return index;
+    }
+    public void setIndex(int index) {
+        this.index = index;
+    }
+
+    public BigInteger getJoin() {
+        return join;
+    }
+    public void setJoin(BigInteger join) {
+        this.join = join;
+    }
+
+    public String getJar() {
+        return jar;
+    }
+    public void setJar(String jar) {
+        this.jar = jar;
+    }
+
+    public Calendar getKey() {
+        return key;
+    }
+    public void setKey(Calendar key) {
+        this.key = key;
+    }
+
+    public Timestamp getKill() {
+        return kill;
+    }
+    public void setKill(Timestamp kill) {
+        this.kill = kill;
+    }
+
+    public Integer getLike() {
+        return like;
+    }
+    public void setLike(Integer like) {
+        this.like = like;
+    }
+
+    public BigDecimal getLoop() {
+        return loop;
+    }
+    public void setLoop(BigDecimal loop) {
+        this.loop = loop;
+    }
+
+    public int getMinute() {
+        return minute;
+    }
+    public void setMinute(int minute) {
+        this.minute = minute;
+    }
+
+    public Date getMerge() {
+        return merge;
+    }
+    public void setMerge(Date merge) {
+        this.merge = merge;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    public int getNot() {
+        return not;
+    }
+    public void setNot(int not) {
+        this.not = not;
+    }
+
+    public Date getOuter() {
+        return outer;
+    }
+    public void setOuter(Date outer) {
+        this.outer = outer;
+    }
+
+    public String getOn() {
+        return on;
+    }
+    public void setOn(String on) {
+        this.on = on;
+    }
+
+    public BigInteger getPrimary() {
+        return primary;
+    }
+    public void setPrimary(BigInteger primary) {
+        this.primary = primary;
+    }
+
+    public int getPurge() {
+        return purge;
+    }
+    public void setPurge(int purge) {
+        this.purge = purge;
+    }
+
+    public int getQuiesce() {
+        return quiesce;
+    }
+    public void setQuiesce(int quiesce) {
+        this.quiesce = quiesce;
+    }
+
+    public String getQuit() {
+        return quit;
+    }
+    public void setQuit(String quit) {
+        this.quit = quit;
+    }
+
+    public BigDecimal getRestrict() {
+        return restrict;
+    }
+    public void setRestrict(BigDecimal restrict) {
+        this.restrict = restrict;
+    }
+
+    public Time getRename() {
+        return rename;
+    }
+    public void setRename(Time rename) {
+        this.rename = rename;
+    }
+
+    public String getSelect() {
+        return select;
+    }
+    public void setSelect(String select) {
+        this.select = select;
+    }
+
+    public int getSavepoint() {
+        return savepoint;
+    }
+    public void setSavepoint(int savepoint) {
+        this.savepoint = savepoint;
+    }
+
+    public Time getTime() {
+        return time;
+    }
+    public void setTime(Time time) {
+        this.time = time;
+    }
+
+    public Timestamp getTimestamp() {
+        return timestamp;
+    }
+    public void setTimestamp(Timestamp timestamp) {
+        this.timestamp = timestamp;
+    }
+
+    public Calendar getTrigger() {
+        return trigger;
+    }
+    public void settrigger(Calendar trigger) {
+        this.trigger = trigger;
+    }
+
+    public int getUpdate() {
+        return update;
+    }
+    public void setUpdate(int update) {
+        this.update = update;
+    }
+
+    public String getUntil() {
+        return until;
+    }
+    public void setUntil(String until) {
+        this.until = until;
+    }
+
+    public String getVarchar() {
+        return varchar;
+    }
+    public void setVarchar(String varchar) {
+        this.varchar = varchar;
+    }
+
+    public int getVariable() {
+        return variable;
+    }
+    public void setVariable(int variable) {
+        this.variable = variable;
+    }
+
+    public Timestamp getWait() {
+        return wait;
+    }
+    public void setWait(Timestamp wait) {
+        this.wait = wait;
+    }
+
+    public BigDecimal getWhere() {
+        return where;
+    }
+    public void setwHere(BigDecimal where) {
+        this.where = where;
+    }
+
+    public BigInteger getXml() {
+        return xml;
+    }
+    public void setxml(BigInteger xml) {
+        this.xml = xml;
+    }
+
+    public int getYear() {
+        return year;
+    }
+    public void setyear(int year) {
+        this.year = year;
+    }
+
+    public int getYears() {
+        return years;
+    }
+    public void setyears(int years) {
+        this.years = years;
+    }
+
+    public Date getZerofill() {
+        return zerofill;
+    }
+    public void setZerofill(Date zerofill) {
+        this.zerofill = zerofill;
+    }
+
+    public String getZone() {
+        return zone;
+    }
+    public void setZone(String zone) {
+        this.zone = zone;
+    } 
+}

Propchange: openjpa/branches/1.3.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/dynamicschema/EntityReservedWords.java
------------------------------------------------------------------------------
    svn:eol-style = native