Hi Thomas,

> I am not sure if I understand the question.

you did ;-)

> (...)
> If you have a real 1:1 behaviour, you can put the foreign key on the
> other side, ...

Indeed it is a 1:1 thing. So it would be possible to switch the FK's
location. But then I'd lose the information in my  "n" table if there
is something associated or not (FK = null).

> If you do not have too many  relations of this sort, a solution would
> be to override the save(..) methods in the persistent Objects.

I choose that one! My solution, worked fine on first try:

Overriding save(Connection):
---snip---
public void save(Connection con) throws TorqueException {
  if (getOtherObject() != null) {
    getOtherObject().save(con);
    setFkOtherObjectId(getOtherObject().getOtherObjectId());
  }
  super.save(con);
}
---snip---


Thank you!

Daniel

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

Reply via email to