You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by di...@apache.org on 2012/06/14 16:49:29 UTC

svn commit: r1350274 - in /openjpa/branches/1.2.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persiste...

Author: dianner
Date: Thu Jun 14 14:49:28 2012
New Revision: 1350274

URL: http://svn.apache.org/viewvc?rev=1350274&view=rev
Log:
OPENJPA-2207 Support manually delimited column names

Added:
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsAnnotation.java   (with props)
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsXml.java   (with props)
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsAnnotation.java   (with props)
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsXml.java   (with props)
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/query-result-orm.xml   (with props)
Modified:
    openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
    openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml

Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=1350274&r1=1350273&r2=1350274&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original)
+++ openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Thu Jun 14 14:49:28 2012
@@ -64,6 +64,7 @@ import java.util.Set;
 
 import javax.sql.DataSource;
 
+import org.apache.commons.lang.CharUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
@@ -348,6 +349,9 @@ public class DBDictionary
     protected final Set fixedSizeTypeNameSet = new HashSet();
     protected final Set typeModifierSet = new HashSet();
     
+    public String leadingDelimiter = "\"";
+    public String trailingDelimiter = "\"";
+    
     /**
      * Some JDBC drivers - ie DB2 type 2 on Z/OS throw exceptions on
      * setQueryTimeout when provided specific input values.
@@ -3752,7 +3756,7 @@ public class DBDictionary
         Column c = new Column();
         c.setSchemaName(colMeta.getString("TABLE_SCHEM"));
         c.setTableName(colMeta.getString("TABLE_NAME"));
-        c.setName(colMeta.getString("COLUMN_NAME"));
+        c.setName(delimit(colMeta.getString("COLUMN_NAME")));
         c.setType(colMeta.getInt("DATA_TYPE"));
         c.setTypeName(colMeta.getString("TYPE_NAME"));
         c.setSize(colMeta.getInt("COLUMN_SIZE"));
@@ -4628,4 +4632,29 @@ public class DBDictionary
     public String getMarkerForInsertUpdate(Column col, Object val) {
        return "?";
     }
+    
+    public String getLeadingDelimiter() {
+        return leadingDelimiter;
+    }
+
+    public void setLeadingDelimiter(String delim) {
+        leadingDelimiter = delim;
+    }
+    
+    public String getTrailingDelimiter() {
+        return trailingDelimiter;
+    }
+
+    public void setTrailingDelimiter(String delim) {
+        trailingDelimiter = delim;
+    }
+    
+    public String delimit(String name) {
+        char[] chars = name.toCharArray();
+        if (!CharUtils.isAsciiAlpha(chars[0])) {
+            return getLeadingDelimiter() + name + getTrailingDelimiter();
+        }
+        
+        return name;
+    }
 }

Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java?rev=1350274&r1=1350273&r2=1350274&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java (original)
+++ openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java Thu Jun 14 14:49:28 2012
@@ -489,8 +489,20 @@ public class ResultSetResult
         throws SQLException {
         if (obj instanceof Number)
             return obj;
+        // If an object is manually delimited, the delimiters need to be stripped in order for this to work
+        if (obj instanceof String)
+            return Numbers.valueOf(findObject(stripDelimiters((String)obj), joins));
         return Numbers.valueOf(findObject(obj, joins));
     }
+    
+    protected String stripDelimiters(String str) {
+        String leadingDelim = _dict.getLeadingDelimiter();
+        String trailingDelim = _dict.getTrailingDelimiter();
+        if (str.startsWith(leadingDelim) && str.endsWith(trailingDelim)) {
+            return str.substring(leadingDelim.length(), str.lastIndexOf(trailingDelim));
+        }
+        return str;
+    }
 
     /**
      * Return the 1-based result set index for the given column or id, or a

Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsAnnotation.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsAnnotation.java?rev=1350274&view=auto
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsAnnotation.java (added)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsAnnotation.java Thu Jun 14 14:49:28 2012
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.openjpa.persistence.results.cls;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityResult;
+import javax.persistence.FieldResult;
+import javax.persistence.Id;
+import javax.persistence.NamedNativeQueries;
+import javax.persistence.NamedNativeQuery;
+import javax.persistence.SqlResultSetMapping;
+
+@NamedNativeQueries({
+@NamedNativeQuery(name = "ResultClsQueryDoubleQuotes", 
+    query = "select \"1\",\"2\" FROM ResultClsAnnoEntity",
+    resultSetMapping = "ResultClsRSMapping", 
+    resultClass = ResultClsAnnotation.class)
+})
+
+@SqlResultSetMapping(name = "ResultClsRSMapping", 
+    entities = @EntityResult(entityClass = ResultClsAnnotation.class, fields = {
+        @FieldResult(name = "id", column = "\"1\""),
+        @FieldResult(name = "description", column = "\"2\"") }))
+@Entity(name = "ResultClsAnnoEntity")
+public class ResultClsAnnotation {
+    public ResultClsAnnotation() {
+    }
+
+    @Id
+    @Column(name = "\"1\"")
+    public String id;
+    @Basic
+    @Column(name = "\"2\"")
+    public String description;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+}

Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsXml.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsXml.java?rev=1350274&view=auto
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsXml.java (added)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsXml.java Thu Jun 14 14:49:28 2012
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.openjpa.persistence.results.cls;
+
+public class ResultClsXml {
+    public ResultClsXml() {
+    }
+
+    public String id;
+    public String description;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+}

Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/ResultClsXml.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsAnnotation.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsAnnotation.java?rev=1350274&view=auto
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsAnnotation.java (added)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsAnnotation.java Thu Jun 14 14:49:28 2012
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.openjpa.persistence.results.cls;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+import org.apache.openjpa.jdbc.sql.DBDictionary;
+import org.apache.openjpa.persistence.test.SQLListenerTestCase;
+
+public class TestResultClsAnnotation extends SQLListenerTestCase {
+    private boolean supportedDB = false;
+    
+    public void setUp() {
+        setUp(ResultClsAnnotation.class, CLEAR_TABLES);
+        assertNotNull(emf);
+        
+        DBDictionary dict = getDBDictionary();
+        if (dict.getLeadingDelimiter().equals("\"") && dict.getTrailingDelimiter().equals("\"")) {
+            supportedDB = true;
+            populate();
+        }
+    }
+
+    public void testIt() {
+        if (!supportedDB)
+            return;
+        
+        EntityManager em = emf.createEntityManager();
+
+        try {
+            Query q = em.createNamedQuery("ResultClsQueryDoubleQuotes");
+            List<ResultClsAnnotation> result = q.getResultList();
+            assertEquals(1, result.size());
+
+            for (Iterator it = result.iterator(); it.hasNext();) {
+                Object obj = (Object) it.next();
+                ResultClsAnnotation ct = (ResultClsAnnotation) obj;
+                assertEquals("id1", ct.getId());
+                assertEquals("description1", ct.getDescription());
+            }
+        } finally {
+            em.close();
+        }
+    }
+
+    private void populate() {
+        EntityManager em = emf.createEntityManager();
+        em.getTransaction().begin();
+
+        ResultClsAnnotation ct = new ResultClsAnnotation();
+        ct.setId("id1");
+        ct.setDescription("description1");
+        em.persist(ct);
+
+        em.getTransaction().commit();
+        em.close();
+    }
+    
+}

Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsXml.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsXml.java?rev=1350274&view=auto
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsXml.java (added)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsXml.java Thu Jun 14 14:49:28 2012
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.openjpa.persistence.results.cls;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+import org.apache.openjpa.jdbc.sql.DBDictionary;
+import org.apache.openjpa.persistence.test.SQLListenerTestCase;
+
+public class TestResultClsXml extends SQLListenerTestCase {
+    private boolean supportedDB = false;
+    
+    public void setUp() {
+        setUp(ResultClsXml.class, CLEAR_TABLES);
+        assertNotNull(emf);
+
+        DBDictionary dict = getDBDictionary();
+        if (dict.getLeadingDelimiter().equals("\"") && dict.getTrailingDelimiter().equals("\"")) {
+            supportedDB = true;
+            populate();
+        }
+    }
+
+    public void testIt() {
+        if (!supportedDB)
+            return;
+        
+        EntityManager em = emf.createEntityManager();
+
+        try {
+            Query q = getQuery(em);
+
+            List<ResultClsXml> result = q.getResultList();
+            assertEquals(1, result.size());
+
+            for (Iterator it = result.iterator(); it.hasNext();) {
+                Object obj = (Object) it.next();
+                ResultClsXml ct = (ResultClsXml) obj;
+                assertEquals("id1", ct.getId());
+                assertEquals("description1", ct.getDescription());
+            }
+
+        } catch (Exception ex) {
+            fail("unexpected exception: " + ex.getMessage());
+            ex.printStackTrace();
+
+        } finally {
+            em.close();
+        }
+    }
+
+    protected String getPersistenceUnitName() {
+        return "query-result";
+    }
+
+    private void populate() {
+        EntityManager em = emf.createEntityManager();
+        em.getTransaction().begin();
+
+        ResultClsXml ct = new ResultClsXml();
+        ct.setId("id1");
+        ct.setDescription("description1");
+        em.persist(ct);
+
+        em.getTransaction().commit();
+        em.close();
+    }
+
+    private Query getQuery(EntityManager em) {
+        // TODO: temp
+        Query query = em.createNamedQuery("ResultClsQueryDoubleQuotes");
+//        DBDictionary dict = getDBDictionary();
+//        Query query = null;
+//        if (dict.getLeadingDelimiter().equals("\"") && dict.getTrailingDelimiter().equals("\"")) {
+//            query = em.createNamedQuery("ResultClsQueryDoubleQuotes");
+//        } else if (dict.getLeadingDelimiter().equals("`") && dict.getTrailingDelimiter().equals("`")) {
+//            query = em.createNamedQuery("ResultClsQueryBackTicks");
+//        } else if (dict.getLeadingDelimiter().equals("[") && dict.getTrailingDelimiter().equals("]")) {
+//            query = em.createNamedQuery("ResultClsQueryBrackets");
+//        } else {
+//            query = em.createNamedQuery("ResultClsQueryDefault");
+//        }
+        return query;
+    }
+}

Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/results/cls/TestResultClsXml.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java?rev=1350274&r1=1350273&r2=1350274&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java (original)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java Thu Jun 14 14:49:28 2012
@@ -176,4 +176,7 @@ public abstract class SingleEMFTestCase
         super.runTest();
     }
     
+    protected DBDictionary getDBDictionary() { 
+        return  ((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance();
+    }
 }

Modified: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml?rev=1350274&r1=1350273&r2=1350274&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml (original)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml Thu Jun 14 14:49:28 2012
@@ -123,5 +123,14 @@
             <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
         </properties>
     </persistence-unit>
+    
+    <persistence-unit name="query-result">
+        <mapping-file>META-INF/query-result-orm.xml</mapping-file>
+        <class>org.apache.openjpa.persistence.results.cls.ResultClsXml</class>
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings"
+                  value="buildSchema(ForeignKeys=true)"/>
+        </properties>
+    </persistence-unit>
 
 </persistence>

Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/query-result-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/query-result-orm.xml?rev=1350274&view=auto
==============================================================================
--- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/query-result-orm.xml (added)
+++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/query-result-orm.xml Thu Jun 14 14:49:28 2012
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.   
+-->
+<entity-mappings version="1.0"
+	xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm  
+
+   http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+
+	<sql-result-set-mapping name="ResultClsRSMapping">
+			<entity-result entity-class="org.apache.openjpa.persistence.results.cls.ResultClsXml">
+				<field-result name="id" column="&quot;1&quot;"></field-result>
+				<field-result name="description" column="&quot;2&quot;"></field-result>
+			</entity-result>
+	</sql-result-set-mapping>
+	<entity class="org.apache.openjpa.persistence.results.cls.ResultClsXml"
+		name="ResultClsXmlEntity" access="PROPERTY">
+		<description>ResultQueryDesc</description>
+		<named-native-query name="ResultClsQueryDoubleQuotes"
+			result-set-mapping="ResultClsRSMapping">
+			<query>select "1","2" FROM ResultClsXmlEntity</query>
+		</named-native-query>
+		<attributes>
+			<id name="id">
+				<column name="&quot;1&quot;" />
+			</id>
+			<basic name="description">
+				<column name="&quot;2&quot;" />
+			</basic>
+		</attributes>
+	</entity>
+	
+</entity-mappings>  
\ No newline at end of file

Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/query-result-orm.xml
------------------------------------------------------------------------------
    svn:eol-style = native