cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r430227 - /incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
Date Thu, 10 Aug 2006 03:13:08 GMT
Author: aadamchik
Date: Wed Aug  9 20:13:08 2006
New Revision: 430227

URL: http://svn.apache.org/viewvc?rev=430227&view=rev
Log:
temporary fix for JPA -> Cayenne Column conversion. Also see CAY-625 - need to fix precision/scale
issues

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java?rev=430227&r1=430226&r2=430227&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/bridge/DataMapConverter.java
Wed Aug  9 20:13:08 2006
@@ -213,7 +213,11 @@
             // TODO, andrus, 4/28/2006 - note that Cayenne DbAttribute's precision is
             // really scale (and precision is not defined at all). Fix this in
             // DbAttribute.
-            dbAttribute.setPrecision(jpaColumn.getScale());
+            
+            // DbAttribute "no scale" means -1, not 0 like in JPA.
+            if (jpaColumn.getScale() > 0) {
+                dbAttribute.setPrecision(jpaColumn.getScale());
+            }
 
             if (jpaColumn.getTable() == null) {
                 throw new JpaProviderException("No default table defined for JpaColumn "



Mime
View raw message