Re: inner join n:1 how to

2006-04-28 Thread Armin Waibel

Hi,

[EMAIL PROTECTED] wrote:

Normally , if i use QueryByCriteria q =
QueryFactory.newQuery(ProductImpl.class, criteria); and criteria contained
some ProductGroup conditions ; and then i will retrieve all data of
ProductImpl that product table outter join with ProductGroup table . May be
in this case i HAVE to use ReportQuery ?



I'm not a query expert, but I think you are right. If you want to mix 
columns of different tables (/objects) you can't use the object based 
criteria api.

You can find an example here
http://db.apache.org/ojb/docu/guides/query.html#Report+Queries

regards,
Armin


Thank in advanced ,
Regards 
--

View this message in context: 
http://www.nabble.com/inner-join-n%3A1-how-to-t1509312.html#a4133579
Sent from the Apache DB - ObjectRelationalBridge Users forum at Nabble.com.


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




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



Re: inner join n:1 how to

2006-04-27 Thread [EMAIL PROTECTED]

Normally , if i use QueryByCriteria q =
QueryFactory.newQuery(ProductImpl.class, criteria); and criteria contained
some ProductGroup conditions ; and then i will retrieve all data of
ProductImpl that product table outter join with ProductGroup table . May be
in this case i HAVE to use ReportQuery ?

Thank in advanced ,
Regards 
--
View this message in context: 
http://www.nabble.com/inner-join-n%3A1-how-to-t1509312.html#a4133579
Sent from the Apache DB - ObjectRelationalBridge Users forum at Nabble.com.


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



inner join n:1 how to

2006-04-25 Thread [EMAIL PROTECTED]

I have two classes Product(table=product) and
ProductGroup(table=productgroup) ; these two tables are n:1 relationship
means 1 row on productgroup may has more than 1 rows on 'produc' table  .
I want to query to get all fields of product table and 2 field of
productgroup table with some conditions for example
select product.id , product.name, product.price , product.productgroupid ,
productgroup.name, productgroup.logo from product a inner join productgroup
b on a.productgroupid = b.id .
How can i do this with ojb 

thank in advanced ,
Regards 


--
View this message in context: 
http://www.nabble.com/inner-join-n%3A1-how-to-t1509312.html#a4094471
Sent from the Apache DB - ObjectRelationalBridge Users forum at Nabble.com.


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