Hello, I'm triying to access inside of the properties of an object inside of an criteria query. I have the follows:
<list name="locationsNatural" schema="public" table="natural$locations" lazy="false">
<key column="locations_" />
<list-index column="locationsindex_" base="1"/>
<many-to-many
class="com.idom.dto.estr.Locations"/>
</list>
inside of Natural class. I'm triying to check if a location is included inside to the locationsNatural list, but I don't know how to. At the moment I have obtained the list of the objects by the following HQL query:
select r.locationsNatural from Natural r where r.id=1
but I prefer to obtained it by Criteria query, at the moment I can access to the object Natural with the id specified but I can't access to locationsNatural because the result that I obtain is < null>.
session.createCriteria(Natural.class).add(Restrictions.eq("id",1")).list();