You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by ed...@mgrinformatica.com.br on 2003/12/29 20:59:01 UTC

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:Joao.Luz@ist.utl.pt]
> 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:servicerespond.dirkmanske@nexgo.de]
> Sent: segunda-feira, 29 de Dezembro de 2003 18:43
> To: ojb-user@db.apache.org
> 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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


AW: AW: ClassPersistenceNotCapableException: java.lang.Integer not found ...

Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
 Hi Edson,

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

Dirk

-----Ursprüngliche Nachricht-----
Von: edson.richter@mgrinformatica.com.br
[mailto:edson.richter@mgrinformatica.com.br] 
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:Joao.Luz@ist.utl.pt]
> 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:servicerespond.dirkmanske@nexgo.de]
> Sent: segunda-feira, 29 de Dezembro de 2003 18:43
> To: ojb-user@db.apache.org
> 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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org