We're currently migrating to Hibernate Core and Search 4.0. I think we're almost done, but we currently get this exception which seems to be a bug (not sure). Before reporting it as issue, I want to be sure it's not due to some coding mistake.
Running the latest Hibernate Core 4.0CR2, we get this exception:
Code:
SEVERE: Allocate exception for servlet mainservlet
org.hibernate.MappingException: Attribute [_repos] refers to unknown entity: [java.util.List]
at org.hibernate.metamodel.source.internal.AssociationResolver.resolve(AssociationResolver.java:57)
at org.hibernate.metamodel.source.internal.AssociationResolver.resolve(AssociationResolver.java:44)
at org.hibernate.metamodel.source.internal.MetadataImpl.<init>(MetadataImpl.java:172)
at org.hibernate.metamodel.source.internal.MetadataBuilderImpl.buildMetadata(MetadataBuilderImpl.java:83)
at org.hibernate.metamodel.MetadataSources.buildMetadata(MetadataSources.java:112)
at utils.HibernateUtilConfigured.<clinit>(HibernateUtilConfigured.java:60)
at utils.DispatchServlet.tryLoadGlobalsAndPerformInit(DispatchServlet.java:19)
...
Full stack trace (scroll down)
Annotations:
Code:
@ManyToMany(fetch = javax.persistence.FetchType.LAZY) @JoinTable(name = "Project_repos_Repo", joinColumns = {@JoinColumn(name = "Project_id_owner")}, inverseJoinColumns = {@JoinColumn(name = "Repo_id_inverse")}) @org.hibernate.annotations.IndexColumn(name = "Projectreposindex", base = 0) @org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE}) protected java.util.List<webdsl.generated.domain.Repo> _repos = new java.util.ArrayList<webdsl.generated.domain.Repo>();
public java.util.List<webdsl.generated.domain.Repo> getRepos()
{
return _repos;
}
HibernateUtilConfigured.java <- Session factory creation using the new metamodel.
Is there a way to fix/workaround this issue? It's currently a blocking issue in our migration branch.