Jo - sorry.
Det var blandt andet fordi jeg brugt den forkerte dialect i opsætningsfilen.
Men jeg mener at denne specifikke fejl kom fordi jeg lavede gav funktion en
int med, hvor den forventede en long. Så følgende løste problemet:
Patient aPatient = (Patient) session.load(Patient.class, new
Long(patientId));
Brian Steensgaard
"Brian Steensgaard" <theonlyone43221@hotmail.com> wrote in message
news:43fbc925$0$11660$ba624c82@nntp02.dk.telia.net...
> Jeg har fundet ud af det.
> "Brian Steensgaard" <theonlyone43221@hotmail.com> wrote in message
> news:43fb4ff4$0$11674$ba624c82@nntp02.dk.telia.net...
>> Jeg har følgende Hibernate mapperfile:
>> <?xml version="1.0"?>
>> <!DOCTYPE hibernate-mapping PUBLIC
>> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
>> "
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
>>
>> <hibernate-mapping>
>> <class name="Person" table="PERSON">
>> <id name="id" type="long" column="PERSON_ID">
>> <generator class="native"/>
>> </id>
>> <property name="_FirstName" column="FirstName"/>
>> <property name="_LastName" column="LastName"/>
>> <property name="_MiddleName" column="MiddleName"/>
>> <property name="_SSN" column="SSN"/>
>> <component name="m_Address" class="Address">
>> <property name="_City" column="City"/>
>> <property name="_Country" column="Country"/>
>> <property name="_Street" column="Street"/>
>> </component>
>> <joined-subclass name="Doctor" table="DOCTOR">
>> <key column="PERSON_ID"/>
>> <property name="_OfficeNumber" column="OfficeNumber"/>
>> <property name="_PagerNumber" column="PagerNumber"/>
>> <set name="m_Patient" table="DOCTOR_PATIENT">
>> <key column="ref_DOCTOR_ID"/>
>> <many-to-many column="ref_PATIENT_ID" class="Patient"/>
>> </set>
>> </joined-subclass>
>> <joined-subclass name="Patient" table="PATIENT">
>> <key column="PERSON_ID" />
>> <property name="_MobilePhoneNumber" column="MobilePhoneNumber"/>
>> <property name="_PhoneNumber" column="PhoneNumber"/>
>> <set name="m_doctors" table="DOCTOR_PATIENT" inverse="true">
>> <key column="ref_PATIENT_ID"/>
>> <many-to-many column="ref_DOCTOR_ID" class="Doctor"/>
>> </set>
>> <set name="m_Record" table="PATIENT_RECORD">
>> <key column="ref_PATIENT_ID"/>
>> <many-to-many column="ref_JOURNAL_ID" class="Record"/>
>> </set>
>> </joined-subclass>
>> </class>
>>
>> </hibernate-mapping>
>>
>> Når jeg forsøger at hente en Patient med:
>> Patient aPatient = (Patient) session.load(Patient.class, patientId);
>>
>> får jeg følgende fejl:
>> 2006-02-21 18:29:52,343 ERROR JDBCExceptionReporter - Statement parameter
>> 1 not set.
>> could not load an entity: [Patient#14]
>>
>> Hvad kan det skyldes? Entryen findes i databasen, og Hibernate er sat
>> rigtigt op, så det er sandsynligvis en fejl i mapperfilen.
>>
>>
>
>