Re: Cayenne Fetch Limit behaviour ?

2009-06-16 Thread Malcolm Edgar
Thanks Robert, I will look at writing a patch. SQL Server syntax is a little different from other databases in that the limit is set after the select. select TOP 20 customer_id, first_name from customer; regards Malcolm Edgar On Wed, Jun 17, 2009 at 12:20 PM, Robert Zeigler wrote: > setFetchLi

Re: Cayenne Fetch Limit behaviour ?

2009-06-16 Thread Robert Zeigler
setFetchLimit has been around for awhile, you're right. But the 2.0 behavior was, for all adapters, if I'm not mistaken, to do an in- memory fetch. 3.0 added the ability to set the offset, and with it, added the option to set the fetch limit at the database level. But, as mentioned, this be

Re: Cayenne Fetch Limit behaviour ?

2009-06-16 Thread Malcolm Edgar
Fetch limit has been around since Cayenne 2.0, and its not working as I expected. Stepping through the code its performing the limit operation after the query has been performed. For example a table with 100,000 rows will be read into memory even with a fetch limit of 100. Then Cayenne provides a

Re: Cayenne Fetch Limit behaviour ?

2009-06-16 Thread Robert Zeigler
I don't think the behavior changed, per se. Rather, setFetchLimit is a relatively new feature, and may not be properly supported by all of the db adaptors yet. Robert On Jun 16, 2009, at 6/167:28 PM , Malcolm Edgar wrote: Hi Guys, On SQL Server we are finding that the setting the Fetch Li

Cayenne Fetch Limit behaviour ?

2009-06-16 Thread Malcolm Edgar
Hi Guys, On SQL Server we are finding that the setting the Fetch Limit on a SelectQuery does not modify the SQL query, to set TOP or SET ROWCOUNT, so the database is not limiting the number of rows returned, and it appears that Cayenne is limiting the number of rows returned in memory? This is ki

RE: Two DataMaps/DataNodes with the same entity/class name

2009-06-16 Thread Weddle, Anthony
How about renaming both classes? If they are different databases, I assume that they are different kinds of users. So XxxxUser and YyyyUser seems appropriate. Just "User" would be a bit ambiguous, I think. Tony -Original Message- From: Borut Bolčina [mailto:borut.bolc...@gmail.com] Sen

Re: Faulting Behavior with setPageSize() and Sort Ordering

2009-06-16 Thread Mike Kienenberger
On Tue, Jun 16, 2009 at 1:58 PM, Joe Baldwin wrote: > That sounds logical.  So if I limit my sort ordering to the initial query > then the objects in pages 2-n will remain hollow? > > (I have a few instances in which there is sort ordering by the client (which > is post query - resultset ordering).

Re: Faulting Behavior with setPageSize() and Sort Ordering

2009-06-16 Thread Andrey Razumovsky
2009/6/16 Joe Baldwin > That sounds logical. So if I limit my sort ordering to the initial query > then the objects in pages 2-n will remain hollow? > Yes. Adding an ordering leads to ORDER BY statements in generated SQL, so all the processing remains the same.

Re: Faulting Behavior with setPageSize() and Sort Ordering

2009-06-16 Thread Joe Baldwin
That sounds logical. So if I limit my sort ordering to the initial query then the objects in pages 2-n will remain hollow? (I have a few instances in which there is sort ordering by the client (which is post query - resultset ordering). I will have to take a look at this design to impleme

Re: Faulting Behavior with setPageSize() and Sort Ordering

2009-06-16 Thread Andrey Razumovsky
The trick of paginated query is that all objects returned are HOLLOW, thus having only identifier. Ordering.orderList will surely resolve *all* records, how else would it know parameters of each object. To order a long list properly you need to set ordering to a query: query.setPageSize(RowsPerPag

Faulting Behavior with setPageSize() and Sort Ordering

2009-06-16 Thread Joe Baldwin
This is a question concerning making performance enhancements with Cayenne directives. Lets say you use the following SelectQuery method query.setPageSize(RowsPerPage); But then you decide to sort order the result list using Ordering order = new Ordering(._PROPERTY, true);

Upgrading from cayenne 2.0.4 to cayenne 3.0.M5/M6

2009-06-16 Thread Marco Gattei
Hi everyone, i'm tryng to upgrade my projects from Cayenne 2.0.4 to Ceyenne 3.0.M5 (M6) Underlyng DB id Oracle 10 Express Edition. In a project i have an extremely ugly looking, long SQLTemplate query that worked fine under Cayenne 2.0.4: SELECT DISTINCT #result('t0.CODENTE' 'String' 'codic

Re: Two DataMaps/DataNodes with the same entity/class name

2009-06-16 Thread Michael Gentry
Hi Borut, you may want to look at my copying DataMaps example: http://cwiki.apache.org/CAY/copying-datamaps.html It is old (still references "objectstyle" instead of "apache", but might work fine with minor changes (like changing the package name). (I haven't tried it on Cayenne 2.x+ yet.) I was

Re: Two DataMaps/DataNodes with the same entity/class name

2009-06-16 Thread Borut Bolčina
Yeah, it is usage patterns that I miss in the documentation. Luckily for me, this list is very responsive! Thanks. 2009/6/16 Andrus Adamchik > Isn't this a better scenario? >> > > > It all depends on your app I guess. > > Andrus > > > > On Jun 16, 2009, at 2:05 PM, Borut Bolčina wrote: > > OK,

Re: Two DataMaps/DataNodes with the same entity/class name

2009-06-16 Thread Andrus Adamchik
Isn't this a better scenario? It all depends on your app I guess. Andrus On Jun 16, 2009, at 2:05 PM, Borut Bolčina wrote: OK, I will try to use two different data domains, after all, the databases are completely unrelated. Isn't this a better scenario? -Borut 2009/6/16 Andrus Adamchi

Re: Two DataMaps/DataNodes with the same entity/class name

2009-06-16 Thread Borut Bolčina
OK, I will try to use two different data domains, after all, the databases are completely unrelated. Isn't this a better scenario? -Borut 2009/6/16 Andrus Adamchik > You have to place them in different DataDomains and use separate contexts > to access them. Or call your class UserSomething (whi

Re: Two DataMaps/DataNodes with the same entity/class name

2009-06-16 Thread Andrus Adamchik
You have to place them in different DataDomains and use separate contexts to access them. Or call your class UserSomething (which looks like a more sensible way to me to resolve a naming conflict). Andrus On Jun 16, 2009, at 1:03 PM, Borut Bolčina wrote: Hi, is it somehow possible to have

Two DataMaps/DataNodes with the same entity/class name

2009-06-16 Thread Borut Bolčina
Hi, is it somehow possible to have two DomainNodes (2 different independent databases) with the same entity/class name? Both databases have table (entity) "user" and I don't want to rename one class to UserSomething. Regards, Borut