openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wisnes...@apache.org
Subject svn commit: r547832 - /openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
Date Fri, 15 Jun 2007 23:45:01 GMT
Author: wisneskid
Date: Fri Jun 15 16:45:00 2007
New Revision: 547832

URL: http://svn.apache.org/viewvc?view=rev&rev=547832
Log:
OPENJPA-240 Feature:Persistent field mapping support for XML column type.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java?view=diff&rev=547832&r1=547831&r2=547832
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
Fri Jun 15 16:45:00 2007
@@ -51,6 +51,7 @@
 import javax.persistence.TableGenerator;
 import javax.persistence.Temporal;
 import javax.persistence.UniqueConstraint;
+import javax.xml.bind.annotation.XmlType;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
@@ -70,6 +71,7 @@
 import org.apache.openjpa.jdbc.meta.strats.VerticalClassStrategy;
 import org.apache.openjpa.jdbc.schema.Column;
 import org.apache.openjpa.jdbc.schema.Unique;
+import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.ClassMetaData;
@@ -1030,6 +1032,15 @@
                 if (cols.isEmpty())
                     cols = new ArrayList<Column>(pcols.length);
                 cols.add(newColumn(pcols[i]));
+            }
+            
+            if (StringUtils.isEmpty(pcols[i].columnDefinition())
+                && fm.getDeclaredType().isAnnotationPresent(XmlType.class)) {
+                DBDictionary dict = ((MappingRepository) getRepository())
+                    .getDBDictionary();
+                if (dict.supportsXMLColumn)
+                  // column maps to xml type
+                  ((Column) cols.get(i)).setTypeName(dict.xmlTypeName);
             }
 
             unique |= (pcols[i].unique()) ? TRUE : FALSE;



Mime
View raw message