cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r606639 - in /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map: JpaSecondaryTable.java JpaTable.java JpaUniqueConstraint.java
Date Sun, 23 Dec 2007 23:48:49 GMT
Author: aadamchik
Date: Sun Dec 23 15:48:44 2007
New Revision: 606639

URL: http://svn.apache.org/viewvc?rev=606639&view=rev
Log:
adding XMLSerializable implementation for debugging

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaSecondaryTable.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaTable.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaUniqueConstraint.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaSecondaryTable.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaSecondaryTable.java?rev=606639&r1=606638&r2=606639&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaSecondaryTable.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaSecondaryTable.java
Sun Dec 23 15:48:44 2007
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.jpa.map;
 
 import java.util.ArrayList;
@@ -26,6 +25,7 @@
 import javax.persistence.SecondaryTable;
 
 import org.apache.cayenne.util.TreeNodeChild;
+import org.apache.cayenne.util.XMLEncoder;
 
 public class JpaSecondaryTable extends JpaTable {
 
@@ -60,5 +60,31 @@
         }
 
         return primaryKeyJoinColumns;
+    }
+
+    @Override
+    public void encodeAsXML(XMLEncoder encoder) {
+        encoder.print("<secondary-table");
+        if (name != null) {
+            encoder.print(" name=\"" + name + "\"");
+        }
+
+        if (catalog != null) {
+            encoder.print(" catalog=\"" + catalog + "\"");
+        }
+
+        if (schema != null) {
+            encoder.print(" schema=\"" + schema + "\"");
+        }
+        
+        encoder.println('>');
+        encoder.indent(1);
+
+        if (primaryKeyJoinColumns != null) {
+            encoder.print(primaryKeyJoinColumns);
+        }
+        
+        encoder.indent(-1);
+        encoder.println("</secondary-table>");
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaTable.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaTable.java?rev=606639&r1=606638&r2=606639&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaTable.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaTable.java
Sun Dec 23 15:48:44 2007
@@ -63,6 +63,28 @@
     }
     
     public void encodeAsXML(XMLEncoder encoder) {
+        encoder.print("<table");
+        if (name != null) {
+            encoder.print(" name=\"" + name + "\"");
+        }
+
+        if (catalog != null) {
+            encoder.print(" catalog=\"" + catalog + "\"");
+        }
+
+        if (schema != null) {
+            encoder.print(" schema=\"" + schema + "\"");
+        }
+        
+        encoder.println('>');
+        encoder.indent(1);
+
+        if (uniqueConstraints != null) {
+            encoder.print(uniqueConstraints);
+        }
+        
+        encoder.indent(-1);
+        encoder.println("</table>");
     }
 
     public String getCatalog() {

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaUniqueConstraint.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaUniqueConstraint.java?rev=606639&r1=606638&r2=606639&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaUniqueConstraint.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaUniqueConstraint.java
Sun Dec 23 15:48:44 2007
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.jpa.map;
 
 import java.util.ArrayList;
@@ -25,7 +24,10 @@
 
 import javax.persistence.UniqueConstraint;
 
-public class JpaUniqueConstraint {
+import org.apache.cayenne.util.XMLEncoder;
+import org.apache.cayenne.util.XMLSerializable;
+
+public class JpaUniqueConstraint implements XMLSerializable {
 
     protected Collection<String> columnNames;
 
@@ -47,5 +49,8 @@
             columnNames = new ArrayList<String>(2);
         }
         return columnNames;
+    }
+
+    public void encodeAsXML(XMLEncoder encoder) {
     }
 }



Mime
View raw message