Hi, I have the following configuaration (see below) with country having many operators and I need to write a method (in the countryDAO) which gets all the countries without getting its partners! how do I do that????
CountryCode:
<hibernate-mapping>
<class name="ch.orange.rps_ws.domain.Country" table="Country">
<id name="id" column="country_id">
<generator class="native"/>
</id>
<property name="country_fr" column="country_fr"/>
<property name="country_it" column="country_it"/>
<property name="country_de" column="country_de"/>
<property name="country_en" column="country_en"/>
<set name="partners" table="partner_in_country">
<key column="country_id"/>
<many-to-many column="partner_id" class="ch.orange.rps_ws.domain.Partner"/>
</set>
</class>
</hibernate-mapping>
PartnerCode:
<hibernate-mapping>
<class name="ch.orange.rps_ws.domain.Partner" table="Partner">
<id name="id" column="partner_id">
<generator class="assigned"/>
</id>
<property name="official_name" column="official_name"/>
<property name="network_name" column="network_name"/>
<property name="handset_display" column="handset_display"/>
<property name="web_address" column="web_address"/>
<property name="map_url" column="map_url"/>
<property name="map_code_2g" column="map_code_2g"/>
<property name="map_code_3g" column="map_code_3g"/>
<property name="visible" column="visible"/>
<set name="services" table="partner_has_service">
<key column="partner_id"/>
<many-to-many column="service_id" class="ch.orange.rps_ws.domain.Service"/>
</set>
</class>
</hibernate-mapping>
my current dao is defined as follows:Code:
public Collection<Country> loadAll()
{
Query q = getSession().createQuery("from Country");
Collection<Country> objects = (Collection<Country>) q.list();
return objects;
}
but when I use it, I get also the contents of its partner set!