3

I have an embeddable model class like this:

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class EmbeddableEntity {

    @Column(name = "property")
    private String property;

}

but generated static metamodel doesn't contain attributes:

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package cz.zjor.model;

import cz.zjor.model.EmbeddableEntity;
import javax.persistence.metamodel.StaticMetamodel;

@StaticMetamodel(EmbeddableEntity.class)
public abstract class EmbeddableEntity_ {
    public EmbeddableEntity_() {
    }
}

I enabled generation via maven like this:

<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.5</version>
<executions>
    <execution>
        <id>process</id>
        <goals>
            <goal>process</goal>
        </goals>
        <phase>generate-sources</phase>
        <configuration>
            <processors>
                <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
            </processors>
        </configuration>
    </execution>
</executions>
<dependencies>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-jpamodelgen</artifactId>
        <version>${hibernate.version}</version>
    </dependency>
</dependencies>
</plugin>

I've seen some posts here showing that attributes are present in static metamodels for embeddable classes and I don't understand why it doesn't work in my case.

I'm using Hibernate 4.3.6.Final

Thanks for help in advance!

zjor
  • 994
  • 2
  • 12
  • 22

0 Answers0