Spring Security authentication

2012-05-22 Thread Tony Giaccone
I'm trying to implement a Spring Security Authentication using Cayenne. The problem is that when the spring security gets called, there's no context associated with the thread. So this method: BaseContext.getThreadObjectContext(); Throws an exception. I'm just not sure at this point how

Re: Queries with multiple tables and results

2012-05-22 Thread Aristedes Maniatis
I'll chime in with the "you probably aren't doing it the Cayenne way" response. Why do you want a mixture of two different records in the one result set? I can think of two reasons: 1. You have two tables which represent similar things: Customers and Suppliers. You want to query them together

Re: Queries with multiple tables and results

2012-05-22 Thread Michael Gentry
Hi Pierre, If you want actual Java objects back (Table1 and Table2), you could do a normal SelectQuery(Table1.class) and add a prefetch to Table2 to efficiently read those records in: http://cayenne.apache.org/doc/prefetching.html Of course, this will read in all records from Table1 and Table2,

Re: Queries with multiple tables and results

2012-05-22 Thread pk_cayenne
Hi Emerson, I try the Option 2 and the result return a list of *DataRow *(which contains my expected values) SQLTemplate query = new SQLTemplate(Table1.class,sql); query.setFetchingDataRows(true); List rows =(List ) context.performQuery(query); Best Regards. -

Re: Queries with multiple tables and results

2012-05-22 Thread Emerson CastaƱeda
Hi Pierre For that cases with queries with many tables I know about two options: Option 1: Coding an store procedure in you database that includes your query and then invoque the procedure recovering the composed results from two or more tables, someway like this: ProcedureQuery query = new P

Re: Queries with multiple tables and results

2012-05-22 Thread pk_cayenne
Hi, Unfortunatly i'm not referring to an "inner join" . What i see in the documentation is that i can only fetch data from a *single table * with the /SelectQuery(Class objectClass, Expression e)/. But in my queries I have at least two tables. I don't how to get a resulset like as list. Somet

Re: Queries with multiple tables and results

2012-05-22 Thread Joe Baldwin
If what you are referring to is an "INNER JOIN" then you might look into the documentation here http://cayenne.apache.org/doc30/qualifier-expressions.html You would need to create a Qualifier Expression object using the Cayenne JOIN Semantics, to give to the Query object. Someone else

Queries with multiple tables and results

2012-05-22 Thread pk_cayenne
Hello, I am a newbie with in cayenne and in english too. I am using cayenne 3.0.2 Here is my probleme I have two tables let say *table1 (id1, name, surname)* and *table2(id2, title, amount)* with oracle database And my query is like this select name, title, amount from table1, table2 where id1