Author: mikedd
Date: Tue May 10 16:00:44 2011
New Revision: 1101519
URL: http://svn.apache.org/viewvc?rev=1101519&view=rev
Log:
OPENJPA-1725: make old behavior optional
Modified:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Modified:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java?rev=1101519&r1=1101518&r2=1101519&view=diff
==============================================================================
---
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java
(original)
+++
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java
Tue May 10 16:00:44 2011
@@ -178,13 +178,18 @@ public class Table
/**
* Set the name of the table. This method can only be called on tables
* that are not part of a schema.
- * @deprecated use setIdentifier(DBIdentifier) instead.
+ * @deprecated use {@link #setIdentifier(DBIdentifier)} instead.
*/
@Deprecated
public void setName(String name) {
setIdentifier(DBIdentifier.newTable(name));
}
+ /**
+ * Set the name of the table. This method can only be called on tables
which are not part of a schema.
+ * @param name The name of the table.
+ * @throws IllegalStateException if {@link #getSchema()} does not return
null.
+ */
public void setIdentifier(DBIdentifier name) {
if (getSchema() != null)
throw new IllegalStateException();
Modified:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=1101519&r1=1101518&r2=1101519&view=diff
==============================================================================
---
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
(original)
+++
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Tue May 10 16:00:44 2011
@@ -337,6 +337,7 @@ public class DBDictionary
public boolean supportsNullTableForGetImportedKeys = false;
public boolean useGetBestRowIdentifierForPrimaryKeys = false;
public boolean requiresAutoCommitForMetaData = false;
+ public boolean tableLengthIncludesSchema = false;
// auto-increment
public int maxAutoAssignNameLength = 31;
@@ -3317,7 +3318,9 @@ public class DBDictionary
*/
public String[] getCreateTableSQL(Table table) {
StringBuilder buf = new StringBuilder();
- String tableName = checkNameLength(getFullIdentifier(table, false),
maxTableNameLength, "long-table-name");
+ String tableName =
+ checkNameLength(getFullIdentifier(table, false),
maxTableNameLength, "long-table-name",
+ tableLengthIncludesSchema);
buf.append("CREATE TABLE ").append(tableName);
if (supportsComments && table.hasComment()) {
buf.append(" ");
@@ -5272,7 +5275,7 @@ public class DBDictionary
* @param msgKey message identifier for the exception.
* @param qualified If true the qualified name of the DBIdentifier will be
used.
*
- * @throws @{link UserException} with the given message key if the given
name is indeed longer.
+ * @throws {@link UserException} with the given message key if the given
name is indeed longer.
* @return the same name.
*/
final String checkNameLength(DBIdentifier identifier, int length, String
msgKey) {
@@ -5288,7 +5291,7 @@ public class DBDictionary
* @param msgKey message identifier for the exception.
* @param qualified If true the qualified name of the DBIdentifier will be
used.
*
- * @throws @{link UserException} with the given message key if the given
name is indeed longer.
+ * @throws {@link UserException} with the given message key if the given
name is indeed longer.
* @return the same name.
*/
final String checkNameLength(DBIdentifier identifier, int length, String
msgKey, boolean qualified) {