Re: Using "relationship != null" qualifier with ObjEntity Inheritance

2008-08-06 Thread Andrus Adamchik
Here is a more detailed answer. A case when a criteria for a subclass / superclass is based on a presence of a given relationship is better addressed with vertical inheritance - something we'll be adding in 3.0. Single table inheritance mapping requires a criteria based on one or more colum

Re: Using "relationship != null" qualifier with ObjEntity Inheritance

2008-08-06 Thread Andrus Adamchik
On Aug 6, 2008, at 2:54 PM, Dave Dombrosky wrote: Do I have to add another column just to hold the type like the documentation example shows? Not the best solution in this case, but I guess it can be done if need be. That would certainly work. Andrus

Re: Using "relationship != null" qualifier with ObjEntity Inheritance

2008-08-06 Thread Dave Dombrosky
Oh boy. What do you recommend in the meantime? Do I have to add another column just to hold the type like the documentation example shows? Not the best solution in this case, but I guess it can be done if need be. -Dave On Wed, Aug 6, 2008 at 2:47 PM, Andrus Adamchik <[EMAIL PROTECTED]> wrote

Re: Using "relationship != null" qualifier with ObjEntity Inheritance

2008-08-06 Thread Andrus Adamchik
Ok, I see. This indeed is a limitation of the inheritance algorithm. We can't evaluate the inheritance qualifier expression in-memory in this case. We can probably improve on that in the future, but there is no easy fix. Andrus On Aug 6, 2008, at 2:29 PM, Dave Dombrosky wrote: Yes it is

Re: Using "relationship != null" qualifier with ObjEntity Inheritance

2008-08-06 Thread Dave Dombrosky
Yes it is just a 1:1 mapping on the relationship. Here is the stack trace: org.apache.cayenne.exp.ExpressionException: [v.3.0-SNAPSHOT Aug 01 2008 19:55:10] Error evaluating expression 'db:some_relationship != null' at org.apache.cayenne.exp.parser.SimpleNode.evaluate(SimpleNode.java:331

Re: Cayenne 3.0M4 ignoring extended data types

2008-08-06 Thread Andrus Adamchik
Hi Chris, Since I haven't got nowhere near the cause yet, I can't suggest a good name either. What's important is that you add steps to reproduce it. Call it anything you feel like. Thanks, Andrus On Aug 6, 2008, at 1:51 PM, Chris Gamache wrote: Just a squeak from the wheel here. I'd cr

Re: Cayenne 3.0M4 ignoring extended data types

2008-08-06 Thread Chris Gamache
Just a squeak from the wheel here. I'd create a bug report, but I'm not sure how to describe it... Join on ExtendedType invalidates ExtendedType when retrieving rows in parent table using SelectQuery ?? That's one idea I have. Please advise. On Mon, Aug 4, 2008 at 5:55 PM, Chris Gamache <[EMAIL P

Re: Using "relationship != null" qualifier with ObjEntity Inheritance

2008-08-06 Thread Andrus Adamchik
Could you post a bigger part of the stack trace (at least everything that has org.apache.cayenne in it)? From what I can see, this is related to in-memory evaluation of the qualifier. If that's a to-one relationship based on FK, intuitively this should work, but it probably hits a limitatio

Re: SQLTemplate and setPageSize()

2008-08-06 Thread Andrus Adamchik
On Aug 6, 2008, at 11:26 AM, Andrus Adamchik wrote: Not quite sure why the root is null. Actually I have a few suspicions why this is happenning, and this may be a bug. Care to log a bug report in Jira? https://issues.apache.org/cayenne/ In the meantime you can use a workaround:

Re: SQLTemplate and setPageSize()

2008-08-06 Thread Andrus Adamchik
Hi Jens, Not quite sure why the root is null. So is named query mapped via the Modeler or do you add it in the code? As an aside (this may have nothing to do with your problem), all mapped queries are shared across DataContexts, so you may have a race condition when you attempt to modify

Re: MS SQL Server: Select Distinct on text datatype

2008-08-06 Thread Andrus Adamchik
On Aug 5, 2008, at 9:55 PM, Lachlan Deck wrote: Are you +1 on providing these with accessors? Actually no, as there is lots of private state there. I want to hide as much as possible. I think we are exposing too much stuff at this level already. If you have a specific adapter customizatio

Re: MS SQL Server: Select Distinct on text datatype

2008-08-06 Thread Lachlan Deck
On 06/08/2008, at 11:32 AM, Andrus Adamchik wrote: On Aug 5, 2008, at 9:24 PM, Lachlan Deck wrote: Was just thinking that there didn't seem to be any hook available to createSqlString() (which calls the above method) to ensure suppressingDistinct is true for this case. Sure. I am +1 on su

SQLTemplate and setPageSize()

2008-08-06 Thread Jens Mayer
Hi, i'm using Cayenne 2.0.4 with Oracle 10 and JDK 1.5. Please have a short look at this code: ... dataCtx, myID are set... SQLTemplate rawQuery = (SQLTemplate)dataCtx.getEntityResolver().lookupQuery("myQuery"); Map params = new HashMap(); params.put("processID", myID); rawQuery.setParameters