cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r576749 - in /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map: JpaColumn.java JpaJoinColumn.java
Date Tue, 18 Sep 2007 07:40:19 GMT
Author: aadamchik
Date: Tue Sep 18 00:40:18 2007
New Revision: 576749

URL: http://svn.apache.org/viewvc?rev=576749&view=rev
Log:
adding XML encoding method to the JPA mapping classes. 
still incomplete, until finished will mostly be used for debugging JPA runtime

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaColumn.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaJoinColumn.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaColumn.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaColumn.java?rev=576749&r1=576748&r2=576749&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaColumn.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaColumn.java
Tue Sep 18 00:40:18 2007
@@ -77,7 +77,7 @@
         }
 
         if (!nullable) {
-            encoder.print(" unique=\"false\"");
+            encoder.print(" nullable=\"false\"");
         }
 
         if (!insertable) {

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaJoinColumn.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaJoinColumn.java?rev=576749&r1=576748&r2=576749&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaJoinColumn.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaJoinColumn.java
Tue Sep 18 00:40:18 2007
@@ -69,6 +69,40 @@
     }
 
     public void encodeAsXML(XMLEncoder encoder) {
+        encoder.print("<join-column");
+        if (name != null) {
+            encoder.print(" name=\"" + name + "\"");
+        }
+
+        if (referencedColumnName != null) {
+            encoder.print(" referenced-column-name=\"" + referencedColumnName + "\"");
+        }
+        
+        if (unique) {
+            encoder.print(" unique=\"true\"");
+        }
+
+        if (!nullable) {
+            encoder.print(" nullable=\"false\"");
+        }
+
+        if (!insertable) {
+            encoder.print(" insertable=\"false\"");
+        }
+
+        if (!updatable) {
+            encoder.print(" updatable=\"false\"");
+        }
+
+        if (columnDefinition != null) {
+            encoder.print(" column-definition=\"" + columnDefinition + "\"");
+        }
+
+        if (table != null) {
+            encoder.print(" table=\"" + table + "\"");
+        }
+
+        encoder.println("/>");
     }
 
     public String getColumnDefinition() {



Mime
View raw message