You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Hoang-Vu PHUNG <hv...@yahoo.fr> on 2004/12/06 15:39:37 UTC
ClassCastException with torque
Hi,
I'm new to torque. I have managed to use torque
(versiion 3.1.1) to generate java classes and sql
script. Then I ran into the problem with nullable
field having foreign key constrainte. This field is a
primitive data so according to one guy in the mailing
list, I have to just add defaultJavaType="object".
Unfortunately, after adding that, I got a
ClassCastException when
trying to insert a object (st. like User user = new
User(); user.setUserFirstName("xxx"); ...;
user.save();
The save method causes an error in BaseUser.java
(generated by Torque) in the setPrimaryKey method. In
the first line of this method, we can see:
SimpleKey[] keys = (SimpleKey[]) key.getValue();
It seems that the cast is not allowed here.
I wonder how it could be possible - having a
successfull automatical generation.
Could somebody here clarify me about these things?
Thanks a lot
Hoang-Vu
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
Avec Yahoo! faites un don et soutenez le Téléthon en cliquant sur http://www.telethon.fr/030-Don/10-10_Don.asp
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
Re: ClassCastException with torque
Posted by Hoang-Vu PHUNG <hv...@yahoo.fr>.
Problem solved. I thought there was a mismatch between
torque 3.1.1 and 3.1. After having reinstalled torque
3.1.1 via maven, it worked again. The version
management is really a headache stuff.
--- Hoang-Vu PHUNG <hv...@yahoo.fr> a écrit :
> Hi,
> I'm new to torque. I have managed to use torque
> (versiion 3.1.1) to generate java classes and sql
> script. Then I ran into the problem with nullable
> field having foreign key constrainte. This field is
> a
> primitive data so according to one guy in the
> mailing
> list, I have to just add defaultJavaType="object".
> Unfortunately, after adding that, I got a
> ClassCastException when
> trying to insert a object (st. like User user = new
> User(); user.setUserFirstName("xxx"); ...;
> user.save();
>
> The save method causes an error in BaseUser.java
> (generated by Torque) in the setPrimaryKey method.
> In
> the first line of this method, we can see:
> SimpleKey[] keys = (SimpleKey[]) key.getValue();
>
> It seems that the cast is not allowed here.
>
> I wonder how it could be possible - having a
> successfull automatical generation.
>
> Could somebody here clarify me about these things?
>
> Thanks a lot
> Hoang-Vu
>
>
>
>
>
>
>
>
>
>
> Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace
> de stockage pour vos mails !
> Créez votre Yahoo! Mail sur
> http://fr.mail.yahoo.com/
>
> Avec Yahoo! faites un don et soutenez le Téléthon en
> cliquant sur
> http://www.telethon.fr/030-Don/10-10_Don.asp
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> torque-user-help@db.apache.org
>
>
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
Avec Yahoo! faites un don et soutenez le Téléthon en cliquant sur http://www.telethon.fr/030-Don/10-10_Don.asp
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org