静态元模型不包含@Embeddable类的属性

时间:2016-02-23 11:13:42

标签: java hibernate maven embeddable

我有一个这样的可嵌入模型类:

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

@Embeddable
public class EmbeddableEntity {

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

}

但生成的静态元模型不包含属性:

//
// 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_() {
    }
}

我通过maven启用了这样的生成:

<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>

我在这里看到一些帖子显示属性存在于可嵌入类的静态元模型中,我不明白为什么它在我的情况下不起作用。

我正在使用Hibernate 4.3.6.Final

提前感谢您的帮助!

0 个答案:

没有答案
相关问题