Hello.
I have a motor table and I do a select * from motor and I retrieve the list.
My mappings are lazy.
In motor I have 4 sets, and hibernate goes inside of my collections and tries to retrieve data there as well.
I don't want it to do that.
Why does it do that? Can anybody please explain?
I can post my mapping file.
Code:
<?xml version="1.0" encoding="ISO-8859-15"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-lazy="true">
<class
name="no.vimenn.baatkatalogen.pojos.MotorData"
table="motor"
>
<id name="id" column="id" type="java.lang.String">
<generator class="assigned" />
</id>
<many-to-one
name="fabrikat"
class="no.vimenn.baatkatalogen.pojos.FabrikatData"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="fabrikatid"
not-null="true"
/>
<many-to-one
name="modellvariant"
class="no.vimenn.baatkatalogen.pojos.ModellvariantData"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="modellvariantid"
not-null="true"
/>
<property
name="modellar"
type="java.lang.String"
update="true"
insert="true"
column="modellar"
unique="false"
not-null="false"
/>
<property
name="modellbetegnelse"
type="java.lang.String"
update="true"
insert="true"
column="modellbetegnelse"
unique="false"
not-null="false"
/>
<property
name="motorvekt"
type="java.lang.String"
update="true"
insert="true"
column="motorvekt"
unique="false"
not-null="false"
/>
<property
name="drivstoff"
type="java.lang.String"
update="true"
insert="true"
column="drivstoff"
unique="false"
not-null="false"
/>
<property
name="type"
type="java.lang.String"
update="true"
insert="true"
column="type"
unique="false"
not-null="false"
/>
<property
name="effekt_hk"
type="java.lang.String"
update="true"
insert="true"
column="effekt_hk"
unique="false"
not-null="false"
/>
<property
name="effekt_kw"
type="java.lang.String"
update="true"
insert="true"
column="effekt_kw"
unique="false"
not-null="false"
/>
<property
name="turtallsomrade_min"
type="java.lang.String"
update="true"
insert="true"
column="turtallsomrade_min"
unique="false"
not-null="false"
/>
<property
name="effekt_ved_min"
type="java.lang.String"
update="true"
insert="true"
column="effekt_ved_min"
unique="false"
not-null="false"
/>
<property
name="antall_sylinder"
type="java.lang.String"
update="true"
insert="true"
column="antall_sylinder"
unique="false"
not-null="false"
/>
<property
name="motorkunstruksjon"
type="java.lang.String"
update="true"
insert="true"
column="motorkunstruksjon"
unique="false"
not-null="false"
/>
<property
name="sylindervolum_cm"
type="java.lang.String"
update="true"
insert="true"
column="sylindervolum_cm"
unique="false"
not-null="false"
/>
<property
name="boring_slaglengde_mm"
type="java.lang.String"
update="true"
insert="true"
column="boring_slaglengde_mm"
unique="false"
not-null="false"
/>
<property
name="ventildrift"
type="java.lang.String"
update="true"
insert="true"
column="ventildrift"
unique="false"
not-null="false"
/>
<property
name="ventiler_pr_sylinder"
type="java.lang.String"
update="true"
insert="true"
column="ventiler_pr_sylinder"
unique="false"
not-null="false"
/>
<property
name="kjolesystem"
type="java.lang.String"
update="true"
insert="true"
column="kjolesystem"
unique="false"
not-null="false"
/>
<property
name="tenningssystem"
type="java.lang.String"
update="true"
insert="true"
column="tenningssystem"
unique="false"
not-null="false"
/>
<property
name="drivstoffsystem"
type="java.lang.String"
update="true"
insert="true"
column="drivstoffsystem"
unique="false"
not-null="false"
/>
<property
name="giringsforhold"
type="java.lang.String"
update="true"
insert="true"
column="giringsforhold"
unique="false"
not-null="false"
/>
<property
name="girskift"
type="java.lang.String"
update="true"
insert="true"
column="girskift"
unique="false"
not-null="false"
/>
<property
name="propellutvalg"
type="java.lang.String"
update="true"
insert="true"
column="propellutvalg"
unique="false"
not-null="false"
/>
<property
name="propellbeskyttelse"
type="java.lang.String"
update="true"
insert="true"
column="propellbeskyttelse"
unique="false"
not-null="false"
/>
<property
name="garantitid"
type="java.lang.String"
update="true"
insert="true"
column="garantitid"
unique="false"
not-null="false"
/>
<property
name="startsystem"
type="java.lang.String"
update="true"
insert="true"
column="startsystem"
unique="false"
not-null="false"
/>
<property
name="tilteposisjon"
type="java.lang.String"
update="true"
insert="true"
column="tilteposisjon"
unique="false"
not-null="false"
/>
<property
name="akterspeilhoyde"
type="java.lang.String"
update="true"
insert="true"
column="akterspeilhoyde"
unique="false"
not-null="false"
/>
<property
name="stromuttak_watt"
type="java.lang.String"
update="true"
insert="true"
column="stromuttak_watt"
unique="false"
not-null="false"
/>
<property
name="generator_ampere"
type="java.lang.String"
update="true"
insert="true"
column="generator_ampere"
unique="false"
not-null="false"
/>
<property
name="styring"
type="java.lang.String"
update="true"
insert="true"
column="styring"
unique="false"
not-null="false"
/>
<property
name="kontraroterende"
type="java.lang.String"
update="true"
insert="true"
column="kontraroterende"
unique="false"
not-null="false"
/>
<property
name="oljeblanding"
type="java.lang.String"
update="true"
insert="true"
column="oljeblanding"
unique="false"
not-null="false"
/>
<property
name="oljetankvolum_liter"
type="java.lang.String"
update="true"
insert="true"
column="oljetankvolum_liter"
unique="false"
not-null="false"
/>
<property
name="std_propp"
type="java.lang.String"
update="true"
insert="true"
column="std_propp"
unique="false"
not-null="false"
/>
<property
name="chokesystem"
type="java.lang.String"
update="true"
insert="true"
column="chokesystem"
unique="false"
not-null="false"
/>
<property
name="pris"
type="java.lang.String"
update="true"
insert="true"
column="pris"
unique="false"
not-null="false"
/>
<property
name="bensintank_liter"
type="java.lang.String"
update="true"
insert="true"
column="bensintank_liter"
unique="false"
not-null="false"
/>
<property
name="bensintank_type"
type="java.lang.String"
update="true"
insert="true"
column="bensintank_type"
unique="false"
not-null="false"
/>
<property
name="produsentland"
type="java.lang.String"
update="true"
insert="true"
column="produsentland"
unique="false"
not-null="false"
/>
<property
name="infotext"
type="java.lang.String"
update="true"
insert="true"
column="infotext"
unique="false"
not-null="false"
/>
<property
name="kort_beskrivelse"
type="java.lang.String"
update="true"
insert="true"
column="kort_beskrivelse"
unique="false"
not-null="false"
/>
<property
name="lang_beskrivelse"
type="java.lang.String"
update="true"
insert="true"
column="lang_beskrivelse"
unique="false"
not-null="false"
/>
<many-to-one
name="importor"
class="no.vimenn.baatkatalogen.pojos.ImportorData"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="importorid"
not-null="true"
/>
<property
name="overordnet_bildesti"
type="java.lang.String"
update="true"
insert="true"
column="overordnet_bildesti"
unique="false"
not-null="false"
/>
<property
name="bildesti"
type="java.lang.String"
update="true"
insert="true"
column="bildesti"
unique="false"
not-null="false"
/>
<property
name="isEnabled"
type="boolean"
update="true"
insert="true"
column="isenabled"
unique="false"
not-null="false"
/>
<set
name="baatmotorer"
lazy="false"
cascade="none"
sort="unsorted"
>
<key column="motorid">
</key>
<one-to-many
class="no.vimenn.baatkatalogen.pojos.BaatMotorData"
/>
</set>
<set
name="motordrever"
lazy="false"
cascade="none"
sort="unsorted"
>
<key column="motorid">
</key>
<one-to-many
class="no.vimenn.baatkatalogen.pojos.MotorDrevData"
/>
</set>
<set
name="motortester"
lazy="false"
cascade="none"
sort="unsorted"
>
<key column="motorid">
</key>
<one-to-many
class="no.vimenn.baatkatalogen.pojos.MotorTestData"
/>
</set>
<set
name="forhandlermotorer"
lazy="false"
cascade="none"
sort="unsorted"
>
<key column="motorid">
</key>
<one-to-many
class="no.vimenn.baatkatalogen.pojos.ForhandlerMotorData"
/>
</set>
</class>
</hibernate-mapping>