openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r551845 - in /openjpa/trunk/openjpa-kernel/src/main: java/org/apache/openjpa/kernel/MethodStoreQuery.java resources/org/apache/openjpa/kernel/localizer.properties
Date Fri, 29 Jun 2007 10:53:07 GMT
Author: pcl
Date: Fri Jun 29 03:53:05 2007
New Revision: 551845

URL: http://svn.apache.org/viewvc?view=rev&rev=551845
Log:
Improved error messages

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java
    openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java?view=diff&rev=551845&r1=551844&r2=551845
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java
Fri Jun 29 03:53:05 2007
@@ -248,6 +248,10 @@
             }
             if (!Modifier.isStatic(meth.getModifiers()))
                 throw new UserException(_loc.get("method-not-static", meth));
+            if (!ResultObjectProvider.class.isAssignableFrom(
+                meth.getReturnType()))
+                throw new UserException(_loc.get("method-return-type-invalid",
+                    meth, meth.getReturnType()));
             _meth = meth;
         }
 

Modified: openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?view=diff&rev=551845&r1=551844&r2=551845
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
Fri Jun 29 03:53:05 2007
@@ -300,6 +300,9 @@
 	qualify the class name or to import its package into this query if the \
 	class is not in the query candidate class'' package. 
 method-not-static: Method "{0}" named in the MethodQL query must be static.
+method-return-type-invalid: Method "{0}" named in the MethodQL query must \
+    have a return type that is assignable from ResultObjectProvider. Return \
+    type is: {1}.
 no-method: You must set the query filter to the name of the method to execute \
 	for this MethodQL query instance.
 method-error: There was an error invoking method "{0}" with arguments "{1}".



Mime
View raw message