]
Oliver Ringel commented on HHH-5948:
------------------------------------
This issue also applies to Hibernate 4.0.0.Final
Trying to get a PluralAttributePath from a @MappedSuperclass throws
org.hibernate.MappingException: Unknown collection role
----------------------------------------------------------------------------------------------------------------------------
Key: HHH-5948
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5948
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.0, 3.6.1
Reporter: Oliver Ringel
Attachments: testcase-hibernate.tgz
I'm trying to get the PluralAttributePath from a collection defined in a
MappedSuperclass
@Entity
public class Person extends PersonBase {
@Basic
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@MappedSuperclass
public abstract class PersonBase {
@Id
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@OneToMany()
private Set<Address> addresses = new HashSet<Address>();
public Set<Address> getAddresses() {
return addresses;
}
public void setAddresses(Set<Address> addresses) {
this.addresses = addresses;
}
}
Executing the following
criteriaQuery = criteriaBuilder.createQuery(Person.class);
root = criteriaQuery.from(Person.class);
Path<?> pathAddresses = root.get("addresses");
throws the exception
org.hibernate.MappingException: Unknown collection role:
testcase.hibernate.PersonBase.addresses
at
org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701)
at
org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58)
at
org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52)
at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:157)
at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:197)
at
testcase.hibernate.HibernateTest.testMappedSuperclassPluralAttribute(HibernateTest.java:53)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: