java - 无法定位静态元模型字段

标签 java hibernate jpa

这个错误是什么意思?

 07:48:42,807 ERROR [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 25) HHH015011: Unable to locate static metamodel field : com.lm.model.UserId_#id 

这个字段是这样定义的

@Embeddable
public class UserId implements Identifier<UserId> {
    @Column( name = "user_id", columnDefinition = "uuid" )
    protected UUID id;                                                                                                                                                                     

最佳答案

我偶然发现了同样的问题。我不认为这是一个错误。 当您添加/编辑实体模型时会发生此错误,例如在实体类中添加了新字段。

要克服此错误,您必须重新生成元模型。 清理您的项目并重新构建它。

如果使用 Maven,运行 mvn clean(前提是您的 POM 配置正确,以便它重新生成 JPA 需要的元模型)。

关于java - 无法定位静态元模型字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22863426/

相关文章:

java - com.fasterxml.jackson.databind.exc.MismatchedInputException : Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token

java - 在 Spring Data JPA 中使用 @Transactional 注解的层

java - org.hibernate.loader.MultipleBagFetchException : cannot simultaneously fetch multiple bags

java - 如何分析hibernate JPA session 信息?

java - 线程 "main"javax.xml.ws.WebServiceException : Failed to access the WSDL. ...(jax-ws) 中出现异常

java - 我应该选择哪种参数类型?扩展父类(super class)型或父类(super class)型的泛型

java - 如何使用关闭的位置服务获取当前位置

java - 组织.hibernate.id.IdentifierGenerationException : ids for this class must be manually assigned before calling save(): while id is autogenerate in oracle

java - Hibernate 中 equals() 方法的问题

java - JPA - 自动重新加载 @OneToMany 依赖项