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 "Vitzethum, Daniel" <Da...@gigatronik.com> on 2004/12/06 13:22:17 UTC

Torque tries to insert 0 into nullable Foreign Key

Hello list,

one more question:

I have a schema with nullable foreign keys of type "INTEGER".
When saving a new object, Torque's buildCriteria method inserts
0 as the according column's value, what is wrong as it should be
null. Even defaults in DB don't work therefore.

My Oracle DB refuses to insert 0 as the foreign key constraint is
violated, what is the right behavior.

Any ideas how to deal with that?


Thanks in advance,

Daniel


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


RE: Torque tries to insert 0 into nullable Foreign Key

Posted by Thomas Fischer <Fi...@seitenbau.net>.




Hi Daniel,

I had the same problem before, and as I needed a quick solution, I used
string foreign keys instead (String foreign keys can be null). I will open
a scarab issue on this problem.

   Thomas

"Vitzethum, Daniel" <Da...@gigatronik.com> schrieb am 06.12.2004
13:22:17:

> Hello list,
>
> one more question:
>
> I have a schema with nullable foreign keys of type "INTEGER".
> When saving a new object, Torque's buildCriteria method inserts
> 0 as the according column's value, what is wrong as it should be
> null. Even defaults in DB don't work therefore.
>
> My Oracle DB refuses to insert 0 as the foreign key constraint is
> violated, what is the right behavior.
>
> Any ideas how to deal with that?
>
>
> Thanks in advance,
>
> Daniel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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