hi,
current i work with castor version 0.9.3.21
i've try to implement a many to many relation with
the example classes and mapping file. i try the
following
myapp.Category cat = new myapp.Category();
cat.setName("CAT 1");
db.begin();
absOql = db.getOQLQuery( "SELECT c FROM myapp.Product c where
id = $1" );
absOql.bind(new Integer(6));
results = absOql.execute();
myapp.Product am = (myapp.Product)results.next();
am.addCategory(cat);
results.close();
db.commit();
db.close();
but no entry has made in table category or category_prod.
if the category entry exist (i made this with sqlplus), no entry
has produced in category _prod.
if i make an entry in category _prod like
prod_id cat_id
6 1
and load Product
db.begin();
absOql = db.getOQLQuery( "SELECT c FROM myapp.Product c where
id = $1" );
absOql.bind(new Integer(6));
results = absOql.execute();
myapp.Product am = (myapp.Product)results.next();
results.close();
db.commit();
db.close();
i get the following output:
:
[test] SQL for loading myapp.Category: SELECT "CATEGORY"."NAME" FROM
"CATEGORY" WHERE "CATEGORY"."ID"=?
[test] SELECT
"PROD"."ID","PROD"."NAME","PROD"."PRICE","PROD"."GROUP_ID","PROD_DETAIL"."ID"
FROM "PROD","PROD_DETAIL" WHERE "PROD"."ID"="PROD_DETAIL"."PROD_ID"(+) AND
("PROD"."ID" = ?)
[test] Castor: Loading myapp.ProductGroup (3)
[test] Castor: Loading myapp.ProductDetail (4)
[test] Castor: Loading myapp.ProductDetail (5)
[test] Castor: Loading myapp.Product (6)
and miss
[test] Castor: Loading myapp.Category(1)
what can i do ?
regards,
antje
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev