diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Company.java b/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Company.java new file mode 100644 index 0000000000..56fb0903ce --- /dev/null +++ b/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Company.java @@ -0,0 +1,10 @@ +package org.hibernate.test.annotations.xml.ejb3; + +import java.util.Map; + +import javax.persistence.MapKeyClass; + +public class Company { + int id; + Map organization; +} diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java b/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java index b5d04e1f18..ef397bc98f 100644 --- a/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java +++ b/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java @@ -67,6 +67,17 @@ public void testXmlDefaultOverriding() throws Exception { tx.rollback(); s.close(); } + + public void testMapKeyClass() throws Exception { + Session s = openSession(); + Transaction tx = s.beginTransaction(); + Company company = new Company(); + s.persist( company ); + s.flush(); + s.clear(); + tx.rollback(); + s.close(); + } protected Class[] getAnnotatedClasses() { return new Class[]{ @@ -83,7 +94,8 @@ protected String[] getXmlFiles() { return new String[]{ "org/hibernate/test/annotations/xml/ejb3/orm.xml", "org/hibernate/test/annotations/xml/ejb3/orm2.xml", - "org/hibernate/test/annotations/xml/ejb3/orm3.xml" + "org/hibernate/test/annotations/xml/ejb3/orm3.xml", + "org/hibernate/test/annotations/xml/ejb3/orm4.xml" }; } } diff --git a/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/VicePresident.java b/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/VicePresident.java new file mode 100644 index 0000000000..715f05972f --- /dev/null +++ b/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/VicePresident.java @@ -0,0 +1,6 @@ +package org.hibernate.test.annotations.xml.ejb3; + +public class VicePresident { + int id; + String name; +} diff --git a/testsuite/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm4.xml b/testsuite/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm4.xml new file mode 100644 index 0000000000..baa12c05c2 --- /dev/null +++ b/testsuite/src/test/resources/org/hibernate/test/annotations/xml/ejb3/orm4.xml @@ -0,0 +1,22 @@ + + + + org.hibernate.test.annotations.xml.ejb3 + + + + + + + + + + + + + + + \ No newline at end of file