Hi Edson,

 this information was exactly what I have been looking for. Now it is
working. Thanks a lot.

Dirk

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 29. Dezember 2003 20:59
An: OJB Users List
Betreff: Re: AW: ClassPersistenceNotCapableException: java.lang.Integer not
found ...

Look, as you defined

        <field-descriptor id="4" name="intActivityIdFK" column="ACTIVITY_ID"
jdbc-type="INTEGER" />

you can't have (or you will always get ClassCastException!!!)

        <reference-descriptor name="intActivityIdFK"

class-ref="de.premiere.plato.app.activity.entity.ActivityModel"
                refresh="true"
                auto-retrieve="true">
                <foreignkey field-id-ref="4" />
        </reference-descriptor>

But you can create an attribute intActivityIdFk (of type int) AND activityFk
(of type
ActivityModel) in your beean, and your class descriptor should be like (and
this should work
fine)

<class-descriptor class="de.activity.entity.ModuleModel" table="TMODULE" > 
        <field-descriptor id="1" name="intModuleAssignedId"
column="MODUL_ASSIGNED_ID" jdbc-type="INTEGER" primarykey="true"
autoincrement="true" />
                <field-descriptor id="2" name="intModuleId"
column="MODUL_ID" jdbc-type="INTEGER" />
        <field-descriptor id="3" name="strModuleExclusive"
column="SIMULTAN_WORK" jdbc-type="CHAR" />
        <field-descriptor id="4" name="intActivityIdFK" column="ACTIVITY_ID"
jdbc-type="INTEGER" />

        <reference-descriptor name="activityFK"

class-ref="de.premiere.plato.app.activity.entity.ActivityModel"
                refresh="true"
                auto-retrieve="true">
                <foreignkey field-id-ref="intActivityIdFk" />
        </reference-descriptor>
</class-descriptor>




Best regards,

Edson Richter

> Thanks for your answer. When I change the reference name to xxxx  I 
> get a MetadataException which states that it can't find a member xxxx 
> in de.plato.app.activity.entity.ModuleModel. Of course there is no 
> member xxxx in this class since I declared all attributes already in 
> the class-descriptor. Any idea?
>
> Dirk
>
>
> -----Ursprüngliche Nachricht-----
> Von: João Vieira da Luz [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 29. Dezember 2003 19:51
> An: 'OJB Users List'
> Betreff: RE: ClassPersistenceNotCapableException: java.lang.Integer 
> not found ...
> Vertraulichkeit: Persönlich
>
> I think your problem is in the name of the reference-descriptor it has 
> the same name that field 4. Try to change the name and I think it will 
> work fine.
>
> -----Original Message-----
> From: Dirk Manske (Service Respond)
> [mailto:[EMAIL PROTECTED]
> Sent: segunda-feira, 29 de Dezembro de 2003 18:43
> To: [EMAIL PROTECTED]
> Subject: ClassPersistenceNotCapableException: java.lang.Integer not 
> found ...
> Sensitivity: Personal
>
> Hi,
>
> Can someone tell me how to set a reference-descriptor for a foreign key?
> Below is an excerpt of my repository-user.xml file. I always get the 
> error
> message: ClassPersistenceNotCapableException: java.lang.Integer not 
> found in repository.xml ... I have no clue what to do. Thx,
>
> Dirk
>
>
> <class-descriptor class="de.activity.entity.ActivityModel"
> table="TPACTIVITY" >
>       <field-descriptor id="1" name="intActivityId" column="ACTIVITY_ID"
> jdbc-type="INTEGER" primarykey="true" autoincrement="true" />
>       <field-descriptor id="2" name="strActivityName"
> column="ACTIVITY_NAME"  jdbc-type="CHAR" /> </class-descriptor>
>
>
> <class-descriptor class="de.activity.entity.ModuleModel" table="TMODULE" >
>       <field-descriptor id="1" name="intModuleAssignedId"
> column="MODUL_ASSIGNED_ID" jdbc-type="INTEGER" primarykey="true"
> autoincrement="true" />
>       <field-descriptor id="2" name="intModuleId" column="MODUL_ID"
> jdbc-type="INTEGER" />
>       <field-descriptor id="3" name="strModuleExclusive"
> column="SIMULTAN_WORK" jdbc-type="CHAR" />
>       <field-descriptor id="4" name="intActivityIdFK" column="ACTIVITY_ID"
> jdbc-type="INTEGER" />
>
>       <reference-descriptor name="intActivityIdFK"
>
> class-ref="de.premiere.plato.app.activity.entity.ActivityModel"
>               refresh="true"
>               auto-retrieve="true">
>               <foreignkey field-id-ref="4" />
>       </reference-descriptor>
> </class-descriptor>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to