openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r711432 - in /openjpa/trunk/openjpa-jdbc/src/main: java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java resources/org/apache/openjpa/jdbc/schema/localizer.properties
Date Tue, 04 Nov 2008 21:56:36 GMT
Author: allee8285
Date: Tue Nov  4 13:56:35 2008
New Revision: 711432

URL: http://svn.apache.org/viewvc?rev=711432&view=rev
Log:
OPENJPA-761 - test for null column object and post a more meaning message to the warning log
in SchemaGenerator.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
    openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java?rev=711432&r1=711431&r2=711432&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
Tue Nov  4 13:56:35 2008
@@ -791,8 +791,13 @@
 
             if (invalids == null || !invalids.contains(fk)) {
                 try {
-                    fk.join(table.getColumn(fkColName),
-                        pkTable.getColumn(pkColName));
+                    Column fkCol = table.getColumn(fkColName);
+                    if (fkCol == null) {
+                        throw new IllegalArgumentException(_loc.get(
+                            "no-column", fkColName, table.getName())
+                            .getMessage());
+                    }
+                    fk.join(fkCol, pkTable.getColumn(pkColName));
                 } catch (IllegalArgumentException iae) {
                     if (_log.isWarnEnabled())
                         _log.warn(_loc.get("bad-join", iae.toString()));

Modified: openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties?rev=711432&r1=711431&r2=711432&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties
Tue Nov  4 13:56:35 2008
@@ -151,3 +151,4 @@
 conn-failed: Failed to connect to DataSource. Verify Driver "{0}", URL "{1}" \
 	and connection properties "{2}" are correct. See the nested exception for \
 	further details.
+no-column: Can not find column "{0}" in table "{1}"



Mime
View raw message