openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r919501 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaQueryImpl.java
Date Fri, 05 Mar 2010 17:06:03 GMT
Author: ppoddar
Date: Fri Mar  5 17:06:02 2010
New Revision: 919501

URL: http://svn.apache.org/viewvc?rev=919501&view=rev
Log:
toString() returns a JPQL-like query string, if possible. Otherwise Object.toString()

Modified:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaQueryImpl.java

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaQueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaQueryImpl.java?rev=919501&r1=919500&r2=919501&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaQueryImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/criteria/CriteriaQueryImpl.java
Fri Mar  5 17:06:02 2010
@@ -711,4 +711,16 @@
             buffer.append(((ExpressionImpl<?>)j).asValue(this)).append(" ");
         }
     }
+    
+    /**
+     * Returns a JPQL-like string, if this receiver is populated. Otherwise 
+     * returns <code>Object.toString()</code>.
+     */
+    public String toString() {
+        try {
+            return toCQL();
+        } catch (Throwable t) {
+            return super.toString();
+        }
+    }
 }



Mime
View raw message