diff --git a/tooling/metamodel-generator/README.md b/tooling/metamodel-generator/README.md index 2de06aa2a4..8a6067e568 100644 --- a/tooling/metamodel-generator/README.md +++ b/tooling/metamodel-generator/README.md @@ -2,13 +2,13 @@ ## Latest stable version -*1.2.0.Final, 06.03.2012* +*1.3.0.Final, 09.08.2013* ## What is it? The Hibernate JPA 2 Metamodel Generator is a Java 6 annotation processor generating meta model classes for JPA 2 type-safe criteria queries. -The processor (*JPAMetaModelEntityProcessor*) processes classes annotated with *@Entity*, *@MappedSuperclass* or *@Embeddable*, as well as entities mapped in */META-INF/orm.xml* and mapping files specified in *persistence.xml*. +The processor, *JPAMetaModelEntityProcessor*, processes classes annotated with *@Entity*, *@MappedSuperclass* or *@Embeddable*, as well as entities mapped in */META-INF/orm.xml* and mapping files specified in *persistence.xml*. ## System Requirements diff --git a/tooling/metamodel-generator/changelog.txt b/tooling/metamodel-generator/changelog.txt index 58bc9d6e26..d3736881ef 100644 --- a/tooling/metamodel-generator/changelog.txt +++ b/tooling/metamodel-generator/changelog.txt @@ -1,6 +1,23 @@ Hibernate JPA 2 Metamodel Generator Changelog ============================================= +1.3.0.Final (09.08.2013) +---------------------- + +** Bug + * [METAGEN-81] - @Embeddable entities don't inherit the access type if it comes from the hierarchy of the containing class + * [METAGEN-82] - Inconsistencies in the way @MappedSuperClass entities are considered + * [METAGEN-85] - MixedConfigurationTest failing + * [METAGEN-86] - Generator exits when discovering in ANY persistence unit + * [METAGEN-88] - End of line in DOS format is hard-coded on ImportContextImpl on "Hibernate Metamodel Generator" + * [METAGEN-90] - Wrong typed metamodel SetAttribute (using an implemented interface) + * [METAGEN-91] - Metamodel generation miss embedded id field if class extends a mapped super class + * [METAGEN-92] - Hibernate Metamodel Generator is not aware of persistence.xml for JPA 2.1 + * [METAGEN-94] - MappedSuperclassWithoutExplicitIdTest failing on certain operating systems + +** Task + * [METAGEN-83] - Upgrade version + 1.2.0.Final (06.03.2012) ---------------------- diff --git a/tooling/metamodel-generator/pom.xml b/tooling/metamodel-generator/pom.xml index 3c9b90eb65..1d6599513e 100644 --- a/tooling/metamodel-generator/pom.xml +++ b/tooling/metamodel-generator/pom.xml @@ -4,7 +4,7 @@ org.hibernate hibernate-jpamodelgen - 1.3.0-SNAPSHOT + 1.4.0-SNAPSHOT Hibernate JPA 2 Metamodel Generator Annotation Processor to generate JPA 2 static metamodel classes @@ -28,7 +28,8 @@ scm:git:git://github.com/hibernate/hibernate-metamodelgen.git scm:git:git@github.com:hibernate/hibernate-metamodelgen.git http://github.com/hibernate/hibernate-metamodelgen - + HEAD + @@ -381,7 +382,7 @@ - + diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java index 81a82b8e70..37b8815ec7 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java @@ -177,7 +177,9 @@ public class MetaAttributeGenerationVisitor extends SimpleTypeVisitor6 getOrmFiles() { + List ormFiles = new ArrayList(); + String dir = TestUtil.fcnToPath( EmbeddedIdWithInheritanceTest.class.getPackage().getName() ); + ormFiles.add( dir + "/orm.xml" ); + return ormFiles; + } +} \ No newline at end of file diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/Ref.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/Ref.java new file mode 100644 index 0000000000..a4a20cd43b --- /dev/null +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/Ref.java @@ -0,0 +1,15 @@ +package org.hibernate.jpamodelgen.test.embeddedid.withinheritance; + +/** + * @author Hardy Ferentschik + */ +public class Ref extends AbstractRef { + public Ref() { + } + + public Ref(int id) { + super( id ); + } +} + + diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/TestEntity.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/TestEntity.java new file mode 100644 index 0000000000..9ad9eb2c30 --- /dev/null +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/TestEntity.java @@ -0,0 +1,25 @@ +package org.hibernate.jpamodelgen.test.embeddedid.withinheritance; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.Table; + +import org.hibernate.annotations.Immutable; + +/** + * @author Hardy Ferentschik + */ +@Entity +@Immutable +@Table(name = "ENTITY") +public class TestEntity implements Serializable { + @EmbeddedId + private Ref ref; + + @Column(name = "NAME", insertable = false, updatable = false, unique = true) + private String name; +} + + diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/EmbeddedIdTest.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/EmbeddedIdNoInheritanceTest.java similarity index 87% rename from tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/EmbeddedIdTest.java rename to tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/EmbeddedIdNoInheritanceTest.java index db890fcb4a..f8f618ba3e 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/EmbeddedIdTest.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/EmbeddedIdNoInheritanceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.hibernate.jpamodelgen.test.embeddedid; +package org.hibernate.jpamodelgen.test.embeddedid.withoutinheritance; import java.util.ArrayList; import java.util.Collection; @@ -31,7 +31,7 @@ import static org.hibernate.jpamodelgen.test.util.TestUtil.assertPresenceOfField /** * @author Hardy Ferentschik */ -public class EmbeddedIdTest extends CompilationTest { +public class EmbeddedIdNoInheritanceTest extends CompilationTest { @Test public void testGeneratedAnnotationNotGenerated() { assertMetamodelClassGeneratedFor( Person.class ); @@ -55,13 +55,13 @@ public class EmbeddedIdTest extends CompilationTest { @Override protected String getPackageNameOfCurrentTest() { - return EmbeddedIdTest.class.getPackage().getName(); + return EmbeddedIdNoInheritanceTest.class.getPackage().getName(); } @Override protected Collection getOrmFiles() { List ormFiles = new ArrayList(); - String dir = TestUtil.fcnToPath( EmbeddedIdTest.class.getPackage().getName() ); + String dir = TestUtil.fcnToPath( EmbeddedIdNoInheritanceTest.class.getPackage().getName() ); ormFiles.add( dir + "/orm.xml" ); return ormFiles; } diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/Person.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/Person.java similarity index 93% rename from tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/Person.java rename to tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/Person.java index 07fb014656..cf86227120 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/Person.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/Person.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.hibernate.jpamodelgen.test.embeddedid; +package org.hibernate.jpamodelgen.test.embeddedid.withoutinheritance; import javax.persistence.EmbeddedId; import javax.persistence.Entity; diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/PersonId.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/PersonId.java similarity index 94% rename from tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/PersonId.java rename to tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/PersonId.java index eca2b18a7a..9f3a496732 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/PersonId.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/PersonId.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.hibernate.jpamodelgen.test.embeddedid; +package org.hibernate.jpamodelgen.test.embeddedid.withoutinheritance; import javax.persistence.Embeddable; diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/XmlPerson.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/XmlPerson.java similarity index 92% rename from tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/XmlPerson.java rename to tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/XmlPerson.java index 74b1482f1a..de9b3e205f 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/XmlPerson.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/XmlPerson.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.hibernate.jpamodelgen.test.embeddedid; +package org.hibernate.jpamodelgen.test.embeddedid.withoutinheritance; /** * @author Hardy Ferentschik diff --git a/tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/orm.xml b/tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/orm.xml new file mode 100644 index 0000000000..636a95d949 --- /dev/null +++ b/tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/withinheritance/orm.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/orm.xml b/tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/orm.xml similarity index 76% rename from tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/orm.xml rename to tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/orm.xml index 0cfc697de7..9297d3e03e 100644 --- a/tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/orm.xml +++ b/tooling/metamodel-generator/src/test/resources/org/hibernate/jpamodelgen/test/embeddedid/withoutinheritance/orm.xml @@ -6,13 +6,13 @@ version="2.0" > org.hibernate.jpamodelgen.test.embeddedid - + - +