1

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

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

提前感谢您的帮助!

4

0 回答 0