[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4581?page=c...
]
Steve Ebersole commented on HHH-4581:
-------------------------------------
It looks like the SNAPSHOTs have "expired". I can push a new jpa-api SNAPSHOT,
but you'll run into issues with jta as well (and jacc too if compiling). I am having
the JBoss Maven guy look at it.
Embedded objects in criteria API does not work
----------------------------------------------
Key: HHH-4581
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4581
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager, query-criteria
Affects Versions: 3.5.0-Beta-2
Reporter: Jaroslaw Lewandowski
Assignee: Steve Ebersole
Priority: Blocker
Fix For: 3.5
Attachments: Client.java, CriteriaApiTest.java, Name.java
Time Spent: 2 hours
Remaining Estimate: 0 minutes
It not possible to use Embedded attribute in Criteria API. E.g. having the following
entity
@Entity
class Client {
@Embedded
private Name name;
}
@Embeddable
public class Name implements Serializable {
@Basic
private String firstName;
@Basic
private String lastName;
}
The following throws an exception
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<ClientCard> cq = cb.createQuery(Client.class);
Root<ClientCard> root = cq.from(ClientCard.class);
cq.where(cb.equal(root.get(Client_.name).get(Name_.firstName)), "blah");
em.createQuery(cq).getResultList();
Saying that Name is not managed entity:
Caused by: java.lang.IllegalArgumentException: Not an managed type: class
com.phorest.memento.server.domain.Name
at org.hibernate.ejb.metamodel.MetamodelImpl.managedType(MetamodelImpl.java:171)
at org.hibernate.ejb.criteria.JoinImpl.<init>(JoinImpl.java:54)
at org.hibernate.ejb.criteria.FromImpl.constructJoin(FromImpl.java:193)
at org.hibernate.ejb.criteria.FromImpl.join(FromImpl.java:176)
at org.hibernate.ejb.criteria.FromImpl.join(FromImpl.java:169)
at org.hibernate.ejb.criteria.FromImpl.get(FromImpl.java:559)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira