ojb-user@db.apache.org
[Top] [All Lists]

Problem with 1:n association.

Subject: Problem with 1:n association.
From: Grzegorz Pypec
Date: Sat, 8 Jan 2005 13:15:26 +0100
Hi

I try associtate multiple Actor's with a single Film. I use x-doclet to make 
this:

<java>
public class Film {
(...)    
/**
* @ojb.collection element-class-ref="tutor.ojb.odmg.filmoteka.Actor"
*                 foreignkey="film_id"
*/
private List actors = new ArrayList();
(...)
}

public class Actor {
(...)
/**
* @ojb.field
*/
private Integer film_id;    
(...)
}
</java>

Everything works fine but I notice that setup-db (from build.xml file) don't 
create the reference in table ACTOR in my database (PotgreSQL). Why?
I guess this maybe risky because somebody may change foreign-key (in some 
record from table ACTOR) to unexists record from table Film.

regards

-- 
| Grzegorz Pypec < greg (at) xtr (dot) net (dot) pl >
| GG# 3744625
| 
| GPG: 21233D71C5C2BD765CF5A69648B26B957FF6CFFE
--

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@xxxxxxxxxxxxx
For additional commands, e-mail: ojb-user-help@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>