Re: howto query this

2006-02-10 Thread Jakob Braeuchi
hi hans, please try the following count-query: Criteria crit = new Criteria(); crit.addEqualTo(phoneNumber.rftelco.rftelcoId, new Integer(65)); broker.getCount(query); the generated sql for hsqldb looks like this: SELECT count(*) FROM CALLS A0 INNER JOIN PHONE_NUMBER A1 ON

Re: howto query this

2006-01-19 Thread Thomas Franke
Hans Novak wrote: Can you give me a hint howto realize that ? I'll take a closer look to your statements and tables and try it. Did you publish all your terms so that I can find them into the previous mails? Regards, Thomas -

Re: howto query this

2006-01-19 Thread Hans Novak
Hello Thomas (and Jakob) Thomas Franke schrieb: I'll take a closer look to your statements and tables and try it. Did you publish all your terms so that I can find them into the previous mails? I'm not shure. So her are my classes and the repository: I hope, thats what you need. Hans

Re: howto query this

2006-01-18 Thread Jakob Braeuchi
hi hans, first you need to define all your classes and their relationships in the repository.xml . and then you could execute a report query selecting count(*). hth jakob Hans Novak schrieb: Hi, i try many hours (without a result) to query this sql statement: SELECT count(*) FROM CALLS

Re: howto query this

2006-01-18 Thread Hans Novak
Hi, this is already done before (and working). I can read and write to the database (mysql) with ojb criterias and querys. My problem is, how i write the criterias and querys that will be translated to a sql command like described. Hans Jakob Braeuchi schrieb: hi hans, first you need to

Re: howto query this

2006-01-18 Thread Jakob Braeuchi
hi hans, if you have the relationships properly defined, you'll not have to care about the joins. Criteria crit = new Criteria(); crit.addEqual(telcoId, new Integer(65)); ReportQueryByCriteria q = QueryFactory.newReportQuery(Calls.class, crit); q.setAttributes(new String[]{count(*)});

Re: howto query this

2006-01-18 Thread Thomas Franke
Hi Hans, PLEASE PLEASE HELP ME ! How about to use ReportQueryByCriteria and the Criteria#addSql method? I think it's the best way to perform this. Hope I could help! Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For