Re: Foreign key constraint problem.

2009-06-17 Thread Aristedes Maniatis
On 18/6/09 7:51 AM, Michael Shea wrote: It looks to me like Cayenne is attempting to insert the new row before deleting the old one; I notice that in DataNode.performQueries, the collection of queries contains 3 queries: An InsertBatchQuery, an UpdateBatchQuery and a DeleteBatchQuery. Looks like

Foreign key constraint problem.

2009-06-17 Thread Michael Shea
Hi guys, I've got something that I'm not sure is a bug or not =)... I have a data map which contains entities "Task", "EMail" and "TaskAssignee". An email can be assigned to a task via an entry in the TaskASsignee table. The DDL for the TaskAssignee table looks like this: create table TaskAs

Object Validation Auto Increment Problem

2009-06-17 Thread Mark Fraser
Hello, I am using Cayenne 2.0.4 with Derby embedded. I am getting a ValidationException "id is required" when I commit changes after creating a new object. I have set the PK Generation Strategy to Database-Generated and set the ID field as Auto Incremented in the modeler. In my map file th

Re: Relationships refresh possible BUG

2009-06-17 Thread Andrus Adamchik
On Jun 17, 2009, at 5:31 PM, lmarc...@smausa.com wrote: Thanks for the clarification, I (mis)understood what was RefreshQuery(). If I understand well "invalidating" means that it will not refresh the cached relationships but will only detect the added/removed relationships ? yes. we are

Re: Relationships refresh possible BUG

2009-06-17 Thread lmarc...@smausa.com
Thanks for the clarification, I (mis)understood what was RefreshQuery(). If I understand well "invalidating" means that it will not refresh the cached relationships but will only detect the added/removed relationships ? So the only way (without prefetching) to _fully_ update the relationships

Re: Relationships refresh possible BUG

2009-06-17 Thread Andrus Adamchik
From your description I don't think there's a problem with either. RelationshipQuery is used for internal Cayenne purposes and by itself will not update the root object, just fetch a list of related objects. RefreshQuery updates the root object, not the related objects. Andrus On Jun 17, 2

Re: Relationships refresh possible BUG

2009-06-17 Thread lmarc...@smausa.com
Sure I will give it a try ! I will try to modify some Cayenne unit tests to reproduce the problem I have with RefreshQuery and RelationshipQuery. Thanks. Laurent. Andrus Adamchik a écrit : Hmm... wonder if the PREFETCH LIMITATION warning is only applicable to the default disjoint prefetches

Re: Cayenne Fetch Limit behaviour ?

2009-06-17 Thread Malcolm Edgar
What appears to work well for SQL Server is: public class SQLServerSelectTranslator extends SelectTranslator { @Override protected void appendLimitAndOffsetClauses(StringBuilder buffer) { QueryMetadata metadata = getQuery().getMetaData(getEntityResolver()); int li

Re: Relationships refresh possible BUG

2009-06-17 Thread Andrus Adamchik
Hmm... wonder if the PREFETCH LIMITATION warning is only applicable to the default disjoint prefetches in 3.0. I have a feeling this type of prefetching should work with joint prefetches since the day when we started using OUTER JOINs for them. Could you give it a try? Andrus On Jun 11, 2

Re: Cayenne Fetch Limit behaviour ?

2009-06-17 Thread Andrus Adamchik
Robert is absolutely right - we have implementations for some adapters, and the rest are doing in-memory ResultSet truncation which is certainly not too efficient. I guess the craziest SQL that we had to generate to date was for Oracle in OracleSelectTranslator. SQLServer version should als

Re: Upgrading from cayenne 2.0.4 to cayenne 3.0.M5/M6

2009-06-17 Thread Marco Gattei
You we're right Andrus, Thank you so much ! Marco Andrus Adamchik ha scritto: Hi Marco, I suspect "oracle.sql.TIMESTAMP" column is at fault here. Cayenne 3.0 expands the type conversion strategy for unknown types to support Serializable types. The side effect of that is a clash with the Oracl

Re: Upgrading from cayenne 2.0.4 to cayenne 3.0.M5/M6

2009-06-17 Thread Andrus Adamchik
Hi Marco, I suspect "oracle.sql.TIMESTAMP" column is at fault here. Cayenne 3.0 expands the type conversion strategy for unknown types to support Serializable types. The side effect of that is a clash with the Oracle non-standard types provided via JDBC. I've no idea if the following work