Hi,
I have a one-to-many association between Class A and Class B. Below is how a list of B has been defined in Class A.
@OneToMany(fetch = FetchType.LAZY) @JoinColumn(name = "ACT_CODE") private List<B> actions = new ArrayList<B>();
I have a criteria query created as follows :
criteria = session.createCriteria(A.getClass());
How can I access an attribute of class B named "testAttribute"? I tried using Fetchtype.JOIN, createCriteria() and createAlias(), but none of them gives me results. I get the following exception :
org.hibernate.QueryException: could not resolve property: testAttribute of: B
Can anyone please help me out?
|