<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>user@cayenne.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/cayenne-user/"/>
<id>http://mail-archives.apache.org/mod_mbox/cayenne-user/</id>
<updated>2009-12-06T11:25:41Z</updated>
<entry>
<title>Re: ParseException with EJBQL expression</title>
<author><name>Dave Lamy &lt;davelamy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3ccf4fbd7e0912041518n25076517p7302e9adcbb18465@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccf4fbd7e0912041518n25076517p7302e9adcbb18465@mail-gmail-com%3e</id>
<updated>2009-12-04T23:18:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
FYI progress made today.  I have successfully implemented a custom EJBSQL
generator and am mainly getting stuff working.

One question:  is there a valid way to express that a relationship should be
an outer join instead of inner?  I'm not finding any docs about this.

For example:

SELECT a.name,COUNT(b) FROM Artist AS a, IN (a.paintings) AS b WHERE b.year
BETWEEN 1800 AND 1900 GROUP BY a.name

I want an Artist with 0 paintings from the years 1800-1900 to still come
through as a result.  Right now of course, it is not because the inner join
removes that artist from consideration.

So close..

Thanks again for the help--
Dave


On Fri, Dec 4, 2009 at 10:09 AM, Dave Lamy &lt;davelamy@gmail.com&gt; wrote:

&gt; So one problem that I now understand is that EJBQL doesn't support
&gt; navigating over to-many collections inline, so "foo.productStyles.taxonomy"
&gt; would be invalid.  In order to do that you have to do this whole
&gt; "IN(foo.productStyles) styles" bit in the FROM clause, at least according to
&gt; the specs.
&gt;
&gt; I don't know if this is causing the parse problem or not.. but it does
&gt; render the Expression.toEJBQL() rather useless.  I would need to do my own
&gt; FROM/WHERE clause generation.
&gt;
&gt; I'll plug away at this and will let you know what I find out..
&gt;
&gt; Dave
&gt;
&gt;
&gt; On Fri, Dec 4, 2009 at 8:09 AM, Dave Lamy &lt;davelamy@gmail.com&gt; wrote:
&gt;
&gt;&gt; I can get rid of the likeIgnoreCase and see what happens.  So I'm OK on
&gt;&gt; the alias part right?  In my other tests it didn't need an "as".  I've
&gt;&gt; mainly been concerned about whether that "doublehop"
&gt;&gt; (.productStyles.taxonomy) would be valid or not.
&gt;&gt;
&gt;&gt; FYI that popped straight out of an Expression.toEJBSQL().  Not sure how
&gt;&gt; best to handle situations like that, where the Expression supports a notion
&gt;&gt; that EJBSQL does not.
&gt;&gt;
&gt;&gt; On Fri, Dec 4, 2009 at 7:31 AM, Andrus Adamchik &lt;andrus@objectstyle.org&gt;wrote:
&gt;&gt;
&gt;&gt;&gt; "likeIgnoreCase" is not valid in EJBQL. Although the error message refers
&gt;&gt;&gt; to something else... strange...
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote:
&gt;&gt;&gt;
&gt;&gt;&gt;  Hey guys--
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I'm really just now getting into using the EJBQLQuery and am having some
&gt;&gt;&gt;&gt; difficulties.  I don't know whether I'm doing something fundamentally
&gt;&gt;&gt;&gt; wrong
&gt;&gt;&gt;&gt; or what.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Here's my EJBQL expression that I'm trying to get parsed (running
&gt;&gt;&gt;&gt; 3.0B1):
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; select COUNT(foo) from ProductCollection foo where
&gt;&gt;&gt;&gt; foo.productStyles.taxonomy likeIgnoreCase '323.%'
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Parsing this query yields the following exception:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.ParseException: Encountered "
&gt;&gt;&gt;&gt; &lt;IDENTIFIER&gt;
&gt;&gt;&gt;&gt; "foo "" at line 1, column 53.
&gt;&gt;&gt;&gt; Was expecting:
&gt;&gt;&gt;&gt;   "(" ...
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9419)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java:9298)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1933)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1928)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java:1585)
&gt;&gt;&gt;&gt;   at
&gt;&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
&gt;&gt;&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
&gt;&gt;&gt;&gt; ...
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; The statement looks legit to me.  Is there like a fundamental something
&gt;&gt;&gt;&gt; I'm
&gt;&gt;&gt;&gt; not understanding about EJBQL?  I saw some docs that showed doing this
&gt;&gt;&gt;&gt; sort
&gt;&gt;&gt;&gt; of join alias "IN" thing,
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; SELECT OBJECT(e) FROM Department d, IN(d.employees) e
&gt;&gt;&gt;&gt;   WHERE d.name = ?1 AND e.salary &gt; ?2
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; My problem is that I'm using Expression.toEJBQL() to gen the where
&gt;&gt;&gt;&gt; clause..
&gt;&gt;&gt;&gt; was hoping to not have to recreate my code that generates the Expression
&gt;&gt;&gt;&gt; object.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Help!
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Dave
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: DBCPDataSourceFactory Issue</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c826E8DD5-17F6-4114-B204-A3A9CB503FDB@objectstyle.org%3e"/>
<id>urn:uuid:%3c826E8DD5-17F6-4114-B204-A3A9CB503FDB@objectstyle-org%3e</id>
<updated>2009-12-04T22:01:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I guess the easiest way is to write your own factory using Cayenne- 
provided one as a template.

BTW, Cayenne implementation of DBCPDataSourceFactory is over- 
engineered. It overlooks a simple way to configure DBCP via  
org.apache.commons.dbcp.BasicDataSource. So the factory internally  
shouldn't look as scary as it does now, and hopefully we'll take  
advantage of that during 3.1 DI refactoring.

Andrus

On Dec 4, 2009, at 9:51 PM, Michael Gentry wrote:

&gt; I'm trying to use DBCPDataSourceFactory and load my data source
&gt; information from a location external to the project.  I keep getting
&gt; errors that it can't find the file.  Has anyone does this
&gt; successfully?
&gt;
&gt; Thanks!
&gt;
&gt; mrg
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>DBCPDataSourceFactory Issue</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c5adb61290912041151m635dd031u2b94928d8d85349b@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290912041151m635dd031u2b94928d8d85349b@mail-gmail-com%3e</id>
<updated>2009-12-04T19:51:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm trying to use DBCPDataSourceFactory and load my data source
information from a location external to the project.  I keep getting
errors that it can't find the file.  Has anyone does this
successfully?

Thanks!

mrg


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Selecting with an offset / paging</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c9ECDB075-0C0A-42EC-A384-EB502F94C014@objectstyle.org%3e"/>
<id>urn:uuid:%3c9ECDB075-0C0A-42EC-A384-EB502F94C014@objectstyle-org%3e</id>
<updated>2009-12-04T17:20:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Also Cayenne 3.0 supports offsets for all types of queries:

http://cayenne.apache.org/doc/api/org/apache/cayenne/query/SelectQuery.html#setFetchOffset(int)

Andrus

On Dec 4, 2009, at 7:12 PM, Michael Gentry wrote:

&gt; Hi Ilya,
&gt;
&gt; Are you at least using a paginated query instead of a regular query?
&gt;
&gt; http://cayenne.apache.org/doc12/paginated-queries.html
&gt;
&gt; mrg
&gt;
&gt;
&gt; On Fri, Dec 4, 2009 at 11:42 AM, Ilya Lazarev &lt;glareff@gmail.com&gt;  
&gt; wrote:
&gt;&gt; using 1.2, forgot to mention
&gt;&gt;
&gt;&gt; On Fri, Dec 4, 2009 at 5:41 PM, Ilya Lazarev &lt;glareff@gmail.com&gt;  
&gt;&gt; wrote:
&gt;&gt;
&gt;&gt;&gt; Hello,
&gt;&gt;&gt;
&gt;&gt;&gt; I have a webapp that accesses an Oralce DB to retrieve records and  
&gt;&gt;&gt; do
&gt;&gt;&gt; paging over the entire resultset (an expression is used that spans  
&gt;&gt;&gt; multiple
&gt;&gt;&gt; tables). Recently when the number of results in total adds up to  
&gt;&gt;&gt; over 30000,
&gt;&gt;&gt; the performance of the select query has dropped to unusable levels  
&gt;&gt;&gt; (30+
&gt;&gt;&gt; seconds per query). The webapp never returns all 30000 rows so  
&gt;&gt;&gt; it's OK for
&gt;&gt;&gt; the time being, but it certainly needs to be addressed.I wanted to  
&gt;&gt;&gt; do a
&gt;&gt;&gt; select with a *"where rownum &gt; a and rownum &lt; b" *type query, but  
&gt;&gt;&gt; so far
&gt;&gt;&gt; have not seen a way to do that. Does anyone have any tips how to  
&gt;&gt;&gt; do this? My
&gt;&gt;&gt; other option is to rewrite the retrieval using SQLTemplate and  
&gt;&gt;&gt; calculate the
&gt;&gt;&gt; dynamic sql based on parameters by hand, correct? Will the  
&gt;&gt;&gt; resultset contain
&gt;&gt;&gt; objects with their relationships that way (ie.
&gt;&gt;&gt; ((TableA)result.get(0)).getToTableB() ?) or flat data rows?
&gt;&gt;&gt;
&gt;&gt;&gt; Thanks!
&gt;&gt;&gt;
&gt;&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Selecting with an offset / paging</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c5adb61290912040912v1011d3bq3ed89a32de9296a9@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290912040912v1011d3bq3ed89a32de9296a9@mail-gmail-com%3e</id>
<updated>2009-12-04T17:12:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Ilya,

Are you at least using a paginated query instead of a regular query?

http://cayenne.apache.org/doc12/paginated-queries.html

mrg


On Fri, Dec 4, 2009 at 11:42 AM, Ilya Lazarev &lt;glareff@gmail.com&gt; wrote:
&gt; using 1.2, forgot to mention
&gt;
&gt; On Fri, Dec 4, 2009 at 5:41 PM, Ilya Lazarev &lt;glareff@gmail.com&gt; wrote:
&gt;
&gt;&gt; Hello,
&gt;&gt;
&gt;&gt; I have a webapp that accesses an Oralce DB to retrieve records and do
&gt;&gt; paging over the entire resultset (an expression is used that spans multiple
&gt;&gt; tables). Recently when the number of results in total adds up to over 30000,
&gt;&gt; the performance of the select query has dropped to unusable levels (30+
&gt;&gt; seconds per query). The webapp never returns all 30000 rows so it's OK for
&gt;&gt; the time being, but it certainly needs to be addressed.I wanted to do a
&gt;&gt; select with a *"where rownum &gt; a and rownum &lt; b" *type query, but so far
&gt;&gt; have not seen a way to do that. Does anyone have any tips how to do this? My
&gt;&gt; other option is to rewrite the retrieval using SQLTemplate and calculate the
&gt;&gt; dynamic sql based on parameters by hand, correct? Will the resultset contain
&gt;&gt; objects with their relationships that way (ie.
&gt;&gt; ((TableA)result.get(0)).getToTableB() ?) or flat data rows?
&gt;&gt;
&gt;&gt; Thanks!
&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Selecting with an offset / paging</title>
<author><name>Ilya Lazarev &lt;glareff@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c759853800912040842l7c81ad73g6d38108e4f56cf2b@mail.gmail.com%3e"/>
<id>urn:uuid:%3c759853800912040842l7c81ad73g6d38108e4f56cf2b@mail-gmail-com%3e</id>
<updated>2009-12-04T16:42:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
using 1.2, forgot to mention

On Fri, Dec 4, 2009 at 5:41 PM, Ilya Lazarev &lt;glareff@gmail.com&gt; wrote:

&gt; Hello,
&gt;
&gt; I have a webapp that accesses an Oralce DB to retrieve records and do
&gt; paging over the entire resultset (an expression is used that spans multiple
&gt; tables). Recently when the number of results in total adds up to over 30000,
&gt; the performance of the select query has dropped to unusable levels (30+
&gt; seconds per query). The webapp never returns all 30000 rows so it's OK for
&gt; the time being, but it certainly needs to be addressed.I wanted to do a
&gt; select with a *"where rownum &gt; a and rownum &lt; b" *type query, but so far
&gt; have not seen a way to do that. Does anyone have any tips how to do this? My
&gt; other option is to rewrite the retrieval using SQLTemplate and calculate the
&gt; dynamic sql based on parameters by hand, correct? Will the resultset contain
&gt; objects with their relationships that way (ie.
&gt; ((TableA)result.get(0)).getToTableB() ?) or flat data rows?
&gt;
&gt; Thanks!
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Selecting with an offset / paging</title>
<author><name>Ilya Lazarev &lt;glareff@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c759853800912040841o75f67f28l456fe6192a89d7a3@mail.gmail.com%3e"/>
<id>urn:uuid:%3c759853800912040841o75f67f28l456fe6192a89d7a3@mail-gmail-com%3e</id>
<updated>2009-12-04T16:41:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

I have a webapp that accesses an Oralce DB to retrieve records and do paging
over the entire resultset (an expression is used that spans multiple
tables). Recently when the number of results in total adds up to over 30000,
the performance of the select query has dropped to unusable levels (30+
seconds per query). The webapp never returns all 30000 rows so it's OK for
the time being, but it certainly needs to be addressed.I wanted to do a
select with a *"where rownum &gt; a and rownum &lt; b" *type query, but so far
have not seen a way to do that. Does anyone have any tips how to do this? My
other option is to rewrite the retrieval using SQLTemplate and calculate the
dynamic sql based on parameters by hand, correct? Will the resultset contain
objects with their relationships that way (ie.
((TableA)result.get(0)).getToTableB() ?) or flat data rows?

Thanks!


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: ParseException with EJBQL expression</title>
<author><name>Dave Lamy &lt;davelamy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3ccf4fbd7e0912040809r51183e99o6a2e69e0f0fcc1e1@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccf4fbd7e0912040809r51183e99o6a2e69e0f0fcc1e1@mail-gmail-com%3e</id>
<updated>2009-12-04T16:09:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
So one problem that I now understand is that EJBQL doesn't support
navigating over to-many collections inline, so "foo.productStyles.taxonomy"
would be invalid.  In order to do that you have to do this whole
"IN(foo.productStyles) styles" bit in the FROM clause, at least according to
the specs.

I don't know if this is causing the parse problem or not.. but it does
render the Expression.toEJBQL() rather useless.  I would need to do my own
FROM/WHERE clause generation.

I'll plug away at this and will let you know what I find out..

Dave

On Fri, Dec 4, 2009 at 8:09 AM, Dave Lamy &lt;davelamy@gmail.com&gt; wrote:

&gt; I can get rid of the likeIgnoreCase and see what happens.  So I'm OK on the
&gt; alias part right?  In my other tests it didn't need an "as".  I've mainly
&gt; been concerned about whether that "doublehop" (.productStyles.taxonomy)
&gt; would be valid or not.
&gt;
&gt; FYI that popped straight out of an Expression.toEJBSQL().  Not sure how
&gt; best to handle situations like that, where the Expression supports a notion
&gt; that EJBSQL does not.
&gt;
&gt; On Fri, Dec 4, 2009 at 7:31 AM, Andrus Adamchik &lt;andrus@objectstyle.org&gt;wrote:
&gt;
&gt;&gt; "likeIgnoreCase" is not valid in EJBQL. Although the error message refers
&gt;&gt; to something else... strange...
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote:
&gt;&gt;
&gt;&gt;  Hey guys--
&gt;&gt;&gt;
&gt;&gt;&gt; I'm really just now getting into using the EJBQLQuery and am having some
&gt;&gt;&gt; difficulties.  I don't know whether I'm doing something fundamentally
&gt;&gt;&gt; wrong
&gt;&gt;&gt; or what.
&gt;&gt;&gt;
&gt;&gt;&gt; Here's my EJBQL expression that I'm trying to get parsed (running 3.0B1):
&gt;&gt;&gt;
&gt;&gt;&gt; select COUNT(foo) from ProductCollection foo where
&gt;&gt;&gt; foo.productStyles.taxonomy likeIgnoreCase '323.%'
&gt;&gt;&gt;
&gt;&gt;&gt; Parsing this query yields the following exception:
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.ParseException: Encountered "
&gt;&gt;&gt; &lt;IDENTIFIER&gt;
&gt;&gt;&gt; "foo "" at line 1, column 53.
&gt;&gt;&gt; Was expecting:
&gt;&gt;&gt;   "(" ...
&gt;&gt;&gt;
&gt;&gt;&gt;   at
&gt;&gt;&gt;
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9419)
&gt;&gt;&gt;   at
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java:9298)
&gt;&gt;&gt;   at
&gt;&gt;&gt;
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1933)
&gt;&gt;&gt;   at
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
&gt;&gt;&gt;   at
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
&gt;&gt;&gt;   at
&gt;&gt;&gt;
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;&gt;   at
&gt;&gt;&gt;
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1928)
&gt;&gt;&gt;   at
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
&gt;&gt;&gt;   at
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
&gt;&gt;&gt;   at
&gt;&gt;&gt;
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java:1585)
&gt;&gt;&gt;   at
&gt;&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
&gt;&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
&gt;&gt;&gt; ...
&gt;&gt;&gt;
&gt;&gt;&gt; The statement looks legit to me.  Is there like a fundamental something
&gt;&gt;&gt; I'm
&gt;&gt;&gt; not understanding about EJBQL?  I saw some docs that showed doing this
&gt;&gt;&gt; sort
&gt;&gt;&gt; of join alias "IN" thing,
&gt;&gt;&gt;
&gt;&gt;&gt; SELECT OBJECT(e) FROM Department d, IN(d.employees) e
&gt;&gt;&gt;   WHERE d.name = ?1 AND e.salary &gt; ?2
&gt;&gt;&gt;
&gt;&gt;&gt; My problem is that I'm using Expression.toEJBQL() to gen the where
&gt;&gt;&gt; clause..
&gt;&gt;&gt; was hoping to not have to recreate my code that generates the Expression
&gt;&gt;&gt; object.
&gt;&gt;&gt;
&gt;&gt;&gt; Help!
&gt;&gt;&gt;
&gt;&gt;&gt; Dave
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: ParseException with EJBQL expression</title>
<author><name>Dave Lamy &lt;davelamy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3ccf4fbd7e0912040609n5051a023q972e1b36cac2b4a2@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccf4fbd7e0912040609n5051a023q972e1b36cac2b4a2@mail-gmail-com%3e</id>
<updated>2009-12-04T14:09:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I can get rid of the likeIgnoreCase and see what happens.  So I'm OK on the
alias part right?  In my other tests it didn't need an "as".  I've mainly
been concerned about whether that "doublehop" (.productStyles.taxonomy)
would be valid or not.

FYI that popped straight out of an Expression.toEJBSQL().  Not sure how best
to handle situations like that, where the Expression supports a notion that
EJBSQL does not.

On Fri, Dec 4, 2009 at 7:31 AM, Andrus Adamchik &lt;andrus@objectstyle.org&gt;wrote:

&gt; "likeIgnoreCase" is not valid in EJBQL. Although the error message refers
&gt; to something else... strange...
&gt;
&gt;
&gt;
&gt; On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote:
&gt;
&gt;  Hey guys--
&gt;&gt;
&gt;&gt; I'm really just now getting into using the EJBQLQuery and am having some
&gt;&gt; difficulties.  I don't know whether I'm doing something fundamentally
&gt;&gt; wrong
&gt;&gt; or what.
&gt;&gt;
&gt;&gt; Here's my EJBQL expression that I'm trying to get parsed (running 3.0B1):
&gt;&gt;
&gt;&gt; select COUNT(foo) from ProductCollection foo where
&gt;&gt; foo.productStyles.taxonomy likeIgnoreCase '323.%'
&gt;&gt;
&gt;&gt; Parsing this query yields the following exception:
&gt;&gt;
&gt;&gt;
&gt;&gt; org.apache.cayenne.ejbql.parser.ParseException: Encountered " &lt;IDENTIFIER&gt;
&gt;&gt; "foo "" at line 1, column 53.
&gt;&gt; Was expecting:
&gt;&gt;   "(" ...
&gt;&gt;
&gt;&gt;   at
&gt;&gt;
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9419)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java:9298)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1933)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
&gt;&gt;   at
&gt;&gt;
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1928)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
&gt;&gt;   at
&gt;&gt;
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java:1585)
&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
&gt;&gt; ...
&gt;&gt;
&gt;&gt; The statement looks legit to me.  Is there like a fundamental something
&gt;&gt; I'm
&gt;&gt; not understanding about EJBQL?  I saw some docs that showed doing this
&gt;&gt; sort
&gt;&gt; of join alias "IN" thing,
&gt;&gt;
&gt;&gt; SELECT OBJECT(e) FROM Department d, IN(d.employees) e
&gt;&gt;   WHERE d.name = ?1 AND e.salary &gt; ?2
&gt;&gt;
&gt;&gt; My problem is that I'm using Expression.toEJBQL() to gen the where
&gt;&gt; clause..
&gt;&gt; was hoping to not have to recreate my code that generates the Expression
&gt;&gt; object.
&gt;&gt;
&gt;&gt; Help!
&gt;&gt;
&gt;&gt; Dave
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: ParseException with EJBQL expression</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c9CBFE084-2984-4E29-B093-29EDE35BEA6F@objectstyle.org%3e"/>
<id>urn:uuid:%3c9CBFE084-2984-4E29-B093-29EDE35BEA6F@objectstyle-org%3e</id>
<updated>2009-12-04T13:31:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
"likeIgnoreCase" is not valid in EJBQL. Although the error message  
refers to something else... strange...


On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote:

&gt; Hey guys--
&gt;
&gt; I'm really just now getting into using the EJBQLQuery and am having  
&gt; some
&gt; difficulties.  I don't know whether I'm doing something  
&gt; fundamentally wrong
&gt; or what.
&gt;
&gt; Here's my EJBQL expression that I'm trying to get parsed (running  
&gt; 3.0B1):
&gt;
&gt; select COUNT(foo) from ProductCollection foo where
&gt; foo.productStyles.taxonomy likeIgnoreCase '323.%'
&gt;
&gt; Parsing this query yields the following exception:
&gt;
&gt;
&gt; org.apache.cayenne.ejbql.parser.ParseException: Encountered "  
&gt; &lt;IDENTIFIER&gt;
&gt; "foo "" at line 1, column 53.
&gt; Was expecting:
&gt;    "(" ...
&gt;
&gt;    at
&gt; org 
&gt; .apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java: 
&gt; 9419)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java: 
&gt; 9298)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java: 
&gt; 1933)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java: 
&gt; 1911)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java: 
&gt; 1776)
&gt;    at
&gt; org 
&gt; .apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java: 
&gt; 1738)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java: 
&gt; 1928)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java: 
&gt; 1911)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java: 
&gt; 1776)
&gt;    at
&gt; org 
&gt; .apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java: 
&gt; 1738)
&gt;    at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java: 
&gt; 1585)
&gt;    at  
&gt; org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
&gt;    at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
&gt; ...
&gt;
&gt; The statement looks legit to me.  Is there like a fundamental  
&gt; something I'm
&gt; not understanding about EJBQL?  I saw some docs that showed doing  
&gt; this sort
&gt; of join alias "IN" thing,
&gt;
&gt; SELECT OBJECT(e) FROM Department d, IN(d.employees) e
&gt;    WHERE d.name = ?1 AND e.salary &gt; ?2
&gt;
&gt; My problem is that I'm using Expression.toEJBQL() to gen the where  
&gt; clause..
&gt; was hoping to not have to recreate my code that generates the  
&gt; Expression
&gt; object.
&gt;
&gt; Help!
&gt;
&gt; Dave



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: ParseException with EJBQL expression</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c2D2EA691-8500-4AAC-AB3B-C9DA27F1BE56@objectstyle.org%3e"/>
<id>urn:uuid:%3c2D2EA691-8500-4AAC-AB3B-C9DA27F1BE56@objectstyle-org%3e</id>
<updated>2009-12-04T13:28:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Umm sorry, "foo" is the alias..

On Dec 4, 2009, at 3:26 PM, Andrus Adamchik wrote:

&gt; Right now our parser requires aliases for entities:
&gt;
&gt;&gt; select COUNT(a) from ProductCollection foo as a where
&gt;&gt; a.productStyles.taxonomy likeIgnoreCase '323.%'
&gt;
&gt; On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote:
&gt;
&gt;&gt; Hey guys--
&gt;&gt;
&gt;&gt; I'm really just now getting into using the EJBQLQuery and am having  
&gt;&gt; some
&gt;&gt; difficulties.  I don't know whether I'm doing something  
&gt;&gt; fundamentally wrong
&gt;&gt; or what.
&gt;&gt;
&gt;&gt; Here's my EJBQL expression that I'm trying to get parsed (running  
&gt;&gt; 3.0B1):
&gt;&gt;
&gt;&gt; select COUNT(foo) from ProductCollection foo where
&gt;&gt; foo.productStyles.taxonomy likeIgnoreCase '323.%'
&gt;&gt;
&gt;&gt; Parsing this query yields the following exception:
&gt;&gt;
&gt;&gt;
&gt;&gt; org.apache.cayenne.ejbql.parser.ParseException: Encountered "  
&gt;&gt; &lt;IDENTIFIER&gt;
&gt;&gt; "foo "" at line 1, column 53.
&gt;&gt; Was expecting:
&gt;&gt;   "(" ...
&gt;&gt;
&gt;&gt;   at
&gt;&gt; org 
&gt;&gt; .apache 
&gt;&gt; .cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9419)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java: 
&gt;&gt; 9298)
&gt;&gt;   at
&gt;&gt; org 
&gt;&gt; .apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java: 
&gt;&gt; 1933)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java: 
&gt;&gt; 1911)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java: 
&gt;&gt; 1776)
&gt;&gt;   at
&gt;&gt; org 
&gt;&gt; .apache 
&gt;&gt; .cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;   at
&gt;&gt; org 
&gt;&gt; .apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java: 
&gt;&gt; 1928)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java: 
&gt;&gt; 1911)
&gt;&gt;   at
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java: 
&gt;&gt; 1776)
&gt;&gt;   at
&gt;&gt; org 
&gt;&gt; .apache 
&gt;&gt; .cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java: 
&gt;&gt; 1585)
&gt;&gt;   at  
&gt;&gt; org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
&gt;&gt;   at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
&gt;&gt; ...
&gt;&gt;
&gt;&gt; The statement looks legit to me.  Is there like a fundamental  
&gt;&gt; something I'm
&gt;&gt; not understanding about EJBQL?  I saw some docs that showed doing  
&gt;&gt; this sort
&gt;&gt; of join alias "IN" thing,
&gt;&gt;
&gt;&gt; SELECT OBJECT(e) FROM Department d, IN(d.employees) e
&gt;&gt;   WHERE d.name = ?1 AND e.salary &gt; ?2
&gt;&gt;
&gt;&gt; My problem is that I'm using Expression.toEJBQL() to gen the where  
&gt;&gt; clause..
&gt;&gt; was hoping to not have to recreate my code that generates the  
&gt;&gt; Expression
&gt;&gt; object.
&gt;&gt;
&gt;&gt; Help!
&gt;&gt;
&gt;&gt; Dave
&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: ParseException with EJBQL expression</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c126270BA-A5EE-4D9D-A3EC-4DC8FA77FA9B@objectstyle.org%3e"/>
<id>urn:uuid:%3c126270BA-A5EE-4D9D-A3EC-4DC8FA77FA9B@objectstyle-org%3e</id>
<updated>2009-12-04T13:26:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Right now our parser requires aliases for entities:

&gt; select COUNT(a) from ProductCollection foo as a where
&gt; a.productStyles.taxonomy likeIgnoreCase '323.%'

On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote:

&gt; Hey guys--
&gt;
&gt; I'm really just now getting into using the EJBQLQuery and am having  
&gt; some
&gt; difficulties.  I don't know whether I'm doing something  
&gt; fundamentally wrong
&gt; or what.
&gt;
&gt; Here's my EJBQL expression that I'm trying to get parsed (running  
&gt; 3.0B1):
&gt;
&gt; select COUNT(foo) from ProductCollection foo where
&gt; foo.productStyles.taxonomy likeIgnoreCase '323.%'
&gt;
&gt; Parsing this query yields the following exception:
&gt;
&gt;
&gt; org.apache.cayenne.ejbql.parser.ParseException: Encountered "  
&gt; &lt;IDENTIFIER&gt;
&gt; "foo "" at line 1, column 53.
&gt; Was expecting:
&gt;    "(" ...
&gt;
&gt;    at
&gt; org 
&gt; .apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java: 
&gt; 9419)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java: 
&gt; 9298)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java: 
&gt; 1933)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java: 
&gt; 1911)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java: 
&gt; 1776)
&gt;    at
&gt; org 
&gt; .apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java: 
&gt; 1738)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java: 
&gt; 1928)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java: 
&gt; 1911)
&gt;    at
&gt; org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java: 
&gt; 1776)
&gt;    at
&gt; org 
&gt; .apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java: 
&gt; 1738)
&gt;    at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java: 
&gt; 1585)
&gt;    at  
&gt; org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
&gt;    at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
&gt; ...
&gt;
&gt; The statement looks legit to me.  Is there like a fundamental  
&gt; something I'm
&gt; not understanding about EJBQL?  I saw some docs that showed doing  
&gt; this sort
&gt; of join alias "IN" thing,
&gt;
&gt; SELECT OBJECT(e) FROM Department d, IN(d.employees) e
&gt;    WHERE d.name = ?1 AND e.salary &gt; ?2
&gt;
&gt; My problem is that I'm using Expression.toEJBQL() to gen the where  
&gt; clause..
&gt; was hoping to not have to recreate my code that generates the  
&gt; Expression
&gt; object.
&gt;
&gt; Help!
&gt;
&gt; Dave



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Referencing ID fields in EJBQL</title>
<author><name>Dave Lamy &lt;davelamy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3ccf4fbd7e0912040516x3b7be753o5c0c956852a4a3b5@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccf4fbd7e0912040516x3b7be753o5c0c956852a4a3b5@mail-gmail-com%3e</id>
<updated>2009-12-04T13:16:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Andrus.  I had actually pulled the trunk and was toying around with
adding an hql-esque .id "magic" field that would automatically reference a
single PK using your synthetic PK ObjAttribute stuff.  I nearly had it
working when I started hitting the problem mentioned in my other post.  I
don't suppose you might have any insight into that one.. :-)  It's a much
more pressing problem for me at the moment.

Dave

On Fri, Dec 4, 2009 at 2:39 AM, Andrus Adamchik &lt;andrus@objectstyle.org&gt;wrote:

&gt; Yeah, in 3.0 EJBQL is somewhat of an implant from the JPA world, so it
&gt; lacks a few Cayenne conveniences. I am certainly in favor to add support for
&gt; "db:" expressions in the future versions (and the patches are welcomed).
&gt;
&gt; For now the option is to map PK column as the object property. Other than
&gt; exposing it to the world, this shouldn't have any side effects. Auto
&gt; generation will still work, etc.
&gt;
&gt; Andrus
&gt;
&gt;
&gt; On Dec 4, 2009, at 12:05 AM, Dave Lamy wrote:
&gt;
&gt;  Hello all--
&gt;&gt;
&gt;&gt; I am curious to know how (if possible) to reference a PK field using
&gt;&gt; EJBQL.
&gt;&gt;
&gt;&gt; I tried using the normal expression "db:" syntax but as I saw in the
&gt;&gt; source
&gt;&gt; this won't work.  EJBQLPathTranslator.processLastPathComponent() appears
&gt;&gt; to
&gt;&gt; assume that the last part of any path will reference either an
&gt;&gt; ObjAttribute
&gt;&gt; or an ObjRelationship, and will throw an IllegalStateException if neither
&gt;&gt; of
&gt;&gt; these are the case.
&gt;&gt;
&gt;&gt; I'd like to have access to the PK field for a couple of purposes.  One,
&gt;&gt; when
&gt;&gt; doing COUNT queries it is faster to do a COUNT(PK) than a COUNT(*).
&gt;&gt; Furthermore, I want to be able to essentially group aggregate function
&gt;&gt; results by objects, which would be impractical to do using the OBJECT(e)
&gt;&gt; notation, so the plan was to perform the group query using IDs and then
&gt;&gt; fill
&gt;&gt; in the results with objects on the way out.
&gt;&gt;
&gt;&gt; Since the call from processLastPathComponent() to
&gt;&gt; processTerminatingAttribute() just resolves into a DbAttribute and thus a
&gt;&gt; column name anyway, wouldn't it be rather simple patch to do a "db:" check
&gt;&gt; on the path component and presume a DB column name instead of an
&gt;&gt; ObjAttribute name?  I imagine I may be oversimplifying the situation, but
&gt;&gt; if
&gt;&gt; not and there is agreement on the method I don't mind doing the patch.
&gt;&gt;
&gt;&gt; Of course, if there is an alternative way to reference PKs that I'm
&gt;&gt; unaware
&gt;&gt; of please enlighten me :-).
&gt;&gt;
&gt;&gt; Thanks--
&gt;&gt; Dave
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Referencing ID fields in EJBQL</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c5AD51A3F-ABA6-40E7-8C9E-414DEC2D928A@objectstyle.org%3e"/>
<id>urn:uuid:%3c5AD51A3F-ABA6-40E7-8C9E-414DEC2D928A@objectstyle-org%3e</id>
<updated>2009-12-04T08:39:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Yeah, in 3.0 EJBQL is somewhat of an implant from the JPA world, so it  
lacks a few Cayenne conveniences. I am certainly in favor to add  
support for "db:" expressions in the future versions (and the patches  
are welcomed).

For now the option is to map PK column as the object property. Other  
than exposing it to the world, this shouldn't have any side effects.  
Auto generation will still work, etc.

Andrus

On Dec 4, 2009, at 12:05 AM, Dave Lamy wrote:

&gt; Hello all--
&gt;
&gt; I am curious to know how (if possible) to reference a PK field using  
&gt; EJBQL.
&gt;
&gt; I tried using the normal expression "db:" syntax but as I saw in the  
&gt; source
&gt; this won't work.  EJBQLPathTranslator.processLastPathComponent()  
&gt; appears to
&gt; assume that the last part of any path will reference either an  
&gt; ObjAttribute
&gt; or an ObjRelationship, and will throw an IllegalStateException if  
&gt; neither of
&gt; these are the case.
&gt;
&gt; I'd like to have access to the PK field for a couple of purposes.   
&gt; One, when
&gt; doing COUNT queries it is faster to do a COUNT(PK) than a COUNT(*).
&gt; Furthermore, I want to be able to essentially group aggregate function
&gt; results by objects, which would be impractical to do using the  
&gt; OBJECT(e)
&gt; notation, so the plan was to perform the group query using IDs and  
&gt; then fill
&gt; in the results with objects on the way out.
&gt;
&gt; Since the call from processLastPathComponent() to
&gt; processTerminatingAttribute() just resolves into a DbAttribute and  
&gt; thus a
&gt; column name anyway, wouldn't it be rather simple patch to do a "db:"  
&gt; check
&gt; on the path component and presume a DB column name instead of an
&gt; ObjAttribute name?  I imagine I may be oversimplifying the  
&gt; situation, but if
&gt; not and there is agreement on the method I don't mind doing the patch.
&gt;
&gt; Of course, if there is an alternative way to reference PKs that I'm  
&gt; unaware
&gt; of please enlighten me :-).
&gt;
&gt; Thanks--
&gt; Dave



</pre>
</div>
</content>
</entry>
<entry>
<title>ParseException with EJBQL expression</title>
<author><name>Dave Lamy &lt;davelamy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3ccf4fbd7e0912031812p3c31d439vb215ea433d042e5a@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccf4fbd7e0912031812p3c31d439vb215ea433d042e5a@mail-gmail-com%3e</id>
<updated>2009-12-04T02:12:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hey guys--

I'm really just now getting into using the EJBQLQuery and am having some
difficulties.  I don't know whether I'm doing something fundamentally wrong
or what.

Here's my EJBQL expression that I'm trying to get parsed (running 3.0B1):

select COUNT(foo) from ProductCollection foo where
foo.productStyles.taxonomy likeIgnoreCase '323.%'

Parsing this query yields the following exception:


org.apache.cayenne.ejbql.parser.ParseException: Encountered " &lt;IDENTIFIER&gt;
"foo "" at line 1, column 53.
Was expecting:
    "(" ...

    at
org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(EJBQL.java:9419)
    at
org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(EJBQL.java:9298)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1933)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_primary(EJBQL.java:1928)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_factor(EJBQL.java:1911)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_term(EJBQL.java:1776)
    at
org.apache.cayenne.ejbql.parser.EJBQL.conditional_expression(EJBQL.java:1738)
    at org.apache.cayenne.ejbql.parser.EJBQL.where_clause(EJBQL.java:1585)
    at org.apache.cayenne.ejbql.parser.EJBQL.select_statement(EJBQL.java:69)
    at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(EJBQL.java:41)
...

The statement looks legit to me.  Is there like a fundamental something I'm
not understanding about EJBQL?  I saw some docs that showed doing this sort
of join alias "IN" thing,

SELECT OBJECT(e) FROM Department d, IN(d.employees) e
    WHERE d.name = ?1 AND e.salary &gt; ?2

My problem is that I'm using Expression.toEJBQL() to gen the where clause..
was hoping to not have to recreate my code that generates the Expression
object.

Help!

Dave


</pre>
</div>
</content>
</entry>
<entry>
<title>Referencing ID fields in EJBQL</title>
<author><name>Dave Lamy &lt;davelamy@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3ccf4fbd7e0912031405q12eb7471o99dcb2d8cbb8c58c@mail.gmail.com%3e"/>
<id>urn:uuid:%3ccf4fbd7e0912031405q12eb7471o99dcb2d8cbb8c58c@mail-gmail-com%3e</id>
<updated>2009-12-03T22:05:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello all--

I am curious to know how (if possible) to reference a PK field using EJBQL.

I tried using the normal expression "db:" syntax but as I saw in the source
this won't work.  EJBQLPathTranslator.processLastPathComponent() appears to
assume that the last part of any path will reference either an ObjAttribute
or an ObjRelationship, and will throw an IllegalStateException if neither of
these are the case.

I'd like to have access to the PK field for a couple of purposes.  One, when
doing COUNT queries it is faster to do a COUNT(PK) than a COUNT(*).
Furthermore, I want to be able to essentially group aggregate function
results by objects, which would be impractical to do using the OBJECT(e)
notation, so the plan was to perform the group query using IDs and then fill
in the results with objects on the way out.

Since the call from processLastPathComponent() to
processTerminatingAttribute() just resolves into a DbAttribute and thus a
column name anyway, wouldn't it be rather simple patch to do a "db:" check
on the path component and presume a DB column name instead of an
ObjAttribute name?  I imagine I may be oversimplifying the situation, but if
not and there is agreement on the method I don't mind doing the patch.

Of course, if there is an alternative way to reference PKs that I'm unaware
of please enlighten me :-).

Thanks--
Dave


</pre>
</div>
</content>
</entry>
<entry>
<title>Problem with joining two tables, base one empty.</title>
<author><name>Eltaeb &lt;eltaeb@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c4B1835D2.9070706@gmail.com%3e"/>
<id>urn:uuid:%3c4B1835D2-9070706@gmail-com%3e</id>
<updated>2009-12-03T22:04:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I've got a problem with a join-query which I can not convert to a set of 
objects the way I'd like.
The problem is that the base table is empty.

I'm querying the following 2 tables:

SetInstance    
-----------
setId          PK
setInstanceId  PK

              
CollectionSetInstance
-----------
setId            PK
setInstanceId    PK
collectionId     PK
number...          

I want to display a list of all SetInstances to the user, including the 
number of times he has the SetInstance (field number...) in his Collection.

The table CollectionSetInstance is initially empty.
When a user adds a SetInstance to his Collection a row in 
CollectionSetInstance is added.
When the user wants to add another SetInstance to his Collection, the 
field 'number' is increased.

Things I've tried:
1. My first attempt was to query SetInstance en outer join 
CollectionSetInstance.
   This retrieves the correct result (all setInstances), but Cayenne 
forces me to add a relation from SetInstance to CollectionSetInstance?
   This is not what I want, because functionally there is not 
relationship between SetInstance and CollectionSetInstance.

2. I've also tried to use a SQLTemplate query and convert that to the 
desired object.
   This has not worked because Cayenne gives me an exception.
   See this code:

SQLTemplate query = new SQLTemplate(CollectionSetInstance.class,
    "SELECT " +
        "SI.setId, " +
        "SI.setInstanceId, " +
        "CSI.collectionId, " +
        "CSI.number " +
     "FROM SetInstance SI " +
     "LEFT OUTER JOIN CollectionSetInstance CSI ON " +
        "CSI.setId = SCI.setId " +
        "AND CSI.setInstanceId = SCI.setInstanceId " );
 
EntityResult result = new EntityResult(CollectionSetCardInstance.class);
result.addDbField(CollectionSetCardInstance.SET_ID_PK_COLUMN, "setId");
result.addDbField(CollectionSetCardInstance.SET_INSTANCE_ID_PK_COLUMN, 
"setInstanceId");
result.addDbField(CollectionSetCardInstance.COLLECTION_ID_PK_COLUMN, 
"collectionId");
result.addObjectField(CollectionSetCardInstance.NUMBER_PROPERTY, "number");

List list = context.performQuery(query);


Can anyone help me out on this one? If you need any more information, 
let me know.

Greets,
Elt


</pre>
</div>
</content>
</entry>
<entry>
<title>Not polymorphic query</title>
<author><name>&quot;sono-un-asino@libero.it&quot; &lt;sono-un-asino@libero.it&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c5812945.1589431259865974756.JavaMail.defaultUser@defaultHost%3e"/>
<id>urn:uuid:%3c5812945-1589431259865974756-JavaMail-defaultUser@defaultHost%3e</id>
<updated>2009-12-03T18:46:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Guys,   
(In Cayenne 2.0 version) Considering the hierarchical class tree to single 
table example, if I perform this kind of not-polymorphic query:    
  
SelectQuery query = new SelectQuery( Manager.class );  
  
I receive this error : "No inheritance - there must be only one override 
set"   
It's my error or I can't do a not-polymorphic query at all?   
__  
Domenico


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: delete new --&gt; transient?</title>
<author><name>Lachlan Deck &lt;lachlan.deck@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c1C767117-AE18-4EB3-BBFA-4AC63E828DBA@gmail.com%3e"/>
<id>urn:uuid:%3c1C767117-AE18-4EB3-BBFA-4AC63E828DBA@gmail-com%3e</id>
<updated>2009-12-01T23:14:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On 02/12/2009, at 9:35 AM, Weddle, Anthony wrote:

&gt; -----Original Message-----
&gt; From: Lachlan Deck [mailto:lachlan.deck@gmail.com]
&gt; 
&gt;&gt; Now, without creating objects in the first place you both have nothing to
&gt;&gt; validate (validateForSave) nor can you roll-back changes (should this have
&gt;&gt; been a previously persisted object). In either case, the controller/ui
&gt;&gt; doesn't care...
&gt; 
&gt; OK. So the main problem is roll-back.

It's 'a' feature. Not the main/only problem.

&gt; Obviously, to validate an object, you need the object but there's no need to validate
a deleted object,

Of course. It won't validate whilst transient, though validateForDelete is relevant otherwise.

&gt; I would have thought (and, presumably, it wouldn't be deleted until analysed).

To provide immediate user feedback, validation is triggered after each event (for us).

&gt; So what is the roll-back point? Is it the last persisted state of the objects?

Sure.

&gt; If so, then you don't need to know the current state of the objects and can create whole
new objects or read them from the database, as you did at the start of the processes.

That's not the problem I'm solving. But sure, if someone hits cancel then that will occur.

&gt; If it is some intermediate state, that you need to roll back to, then you should store
that state in the program, not the object context, as far as I can tell.

I've got it working using Cayenne as I believe it should (though still not 100% that it covers
all transient possibilities). Intermixing non-object state and custom state wouldn't be preferable.

&gt; The context is there because of Cayenne, not because of the logic in your program.

Well.... on this I'll admit that I come from EOF where this particular action/case didn't
require as much, um, thinking :-) To put it another way, I understand your logic here I just
don't completely agree with it :)

&gt; Perhaps you can delay any deletion, in context terms, until you know what is ultimately
going to be saved.

That's not practical. If a save action is triggered that needs further work to be done by
the user (requiring a subsequent save) at which point are the deletions inserted? It doesn't
work.

&gt;&gt;&gt; From the program's point of view, it's clear that TRANSIENT can be
&gt;&gt;&gt; treated exactly the same as DELETED, since they both mean that some
&gt;&gt;&gt; persistable object previously created in the program has subsequently
&gt;&gt;&gt; been deleted by the program.
&gt; 
&gt;&gt; My point (and clarifying question, however) is that if TRANSIENT does not
&gt;&gt; always mean that ... and it's possible for objects to be transient in
&gt;&gt; other ways then that's not good enough. It'll do for now - but I'd like to
&gt;&gt; put code in the entity that works in all circumstances and not just for
&gt;&gt; this particular case.
&gt; 
&gt; Ah, well, if you really do need to use context state for your code, then that would have
to be the question to those that know: what situations can result in an object state of TRANSIENT?
Maybe you can confidently assume that TRANSIENT is the same as DELETED, from the program's
point of view. If not, then you'll have to avoid using the context for the purposes of your
application's logic.

Certainly I'd have to handle it otherwise... which would be a shame for it diminishes the
transparency of dealing with creating/deleting/updating objects no matter their destination.

&gt;&gt;&gt; From the database's point of view, the states can't be treated the same
&gt;&gt;&gt; way; the DELETED object has to be deleted from the database, the
&gt;&gt;&gt; TRANSIENT object was never in the database and can be ignored.
&gt; 
&gt;&gt; That's the easy part, sure. But from user-code's point of view, we don't
&gt;&gt; care about the database. It's an abstraction. :-) Thinking in terms of the
&gt;&gt; database when using an orm ain't best practice (of course you need to at
&gt;&gt; times). Think in terms of objects.
&gt; 
&gt; Indeed. By the same token, it is perhaps unwise to use something (the object context)
that exists purely because of the persistence framework, unless you are strictly coding persistence
logic.

We are strictly coding persistence logic. Even sql has conditional statements that may or
may not cause alterations to any rows... that's the key point that imho you're missing...

&gt; If you ever change the persistence framework, it may be hard to untangle the old one
from your code.

That's always going to be true I'm afraid.

Anyway, thanks for your input.

with regards,
--

Lachlan Deck



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: delete new --&gt; transient?</title>
<author><name>&quot;Weddle, Anthony&quot; &lt;Anthony.Weddle@bluescopesteel.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c1186BC7DC14A424D80E97A63D8517A861952EEE19E@STLAKLXCH02.nzsakl.bhp.com.au%3e"/>
<id>urn:uuid:%3c1186BC7DC14A424D80E97A63D8517A861952EEE19E@STLAKLXCH02-nzsakl-bhp-com-au%3e</id>
<updated>2009-12-01T22:35:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
-----Original Message-----
From: Lachlan Deck [mailto:lachlan.deck@gmail.com]

&gt; Now, without creating objects in the first place you both have nothing to
&gt; validate (validateForSave) nor can you roll-back changes (should this have
&gt; been a previously persisted object). In either case, the controller/ui
&gt; doesn't care...

OK. So the main problem is roll-back. Obviously, to validate an object, you need the object
but there's no need to validate a deleted object, I would have thought (and, presumably, it
wouldn't be deleted until analysed). So what is the roll-back point? Is it the last persisted
state of the objects? If so, then you don't need to know the current state of the objects
and can create whole new objects or read them from the database, as you did at the start of
the processes. If it is some intermediate state, that you need to roll back to, then you should
store that state in the program, not the object context, as far as I can tell. The context
is there because of Cayenne, not because of the logic in your program. Perhaps you can delay
any deletion, in context terms, until you know what is ultimately going to be saved.

&gt;&gt; From the program's point of view, it's clear that TRANSIENT can be
&gt;&gt; treated exactly the same as DELETED, since they both mean that some
&gt;&gt; persistable object previously created in the program has subsequently
&gt;&gt; been deleted by the program.

&gt; My point (and clarifying question, however) is that if TRANSIENT does not
&gt; always mean that ... and it's possible for objects to be transient in
&gt; other ways then that's not good enough. It'll do for now - but I'd like to
&gt; put code in the entity that works in all circumstances and not just for
&gt; this particular case.

Ah, well, if you really do need to use context state for your code, then that would have to
be the question to those that know: what situations can result in an object state of TRANSIENT?
Maybe you can confidently assume that TRANSIENT is the same as DELETED, from the program's
point of view. If not, then you'll have to avoid using the context for the purposes of your
application's logic.

&gt;&gt; From the database's point of view, the states can't be treated the same
&gt;&gt; way; the DELETED object has to be deleted from the database, the
&gt;&gt; TRANSIENT object was never in the database and can be ignored.

&gt; That's the easy part, sure. But from user-code's point of view, we don't
&gt; care about the database. It's an abstraction. :-) Thinking in terms of the
&gt; database when using an orm ain't best practice (of course you need to at
&gt; times). Think in terms of objects.

Indeed. By the same token, it is perhaps unwise to use something (the object context) that
exists purely because of the persistence framework, unless you are strictly coding persistence
logic. If you ever change the persistence framework, it may be hard to untangle the old one
from your code.

Tony



NOTICE - This message and any attached files may contain information that is confidential,
legally privileged or proprietary. It is intended only for use by the intended recipient.
If you are not the intended recipient or the person responsible for delivering the message
to the intended recipient, be advised that you have received this message in error. Any dissemination,
copying, use or re-transmission of this message or attachment, or the disclosure of any information
therein, is strictly forbidden. BlueScope Steel Limited does not represent or guarantee that
this message or attachment is free of errors, virus or interference.

If you have received this message in error please notify the sender immediately and delete
the message. Any views expressed in this email are not necessarily the views of BlueScope
Steel Limited.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: delete new --&gt; transient?</title>
<author><name>Lachlan Deck &lt;lachlan.deck@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c42B2C36B-B748-4080-ADED-78EC98B3331C@gmail.com%3e"/>
<id>urn:uuid:%3c42B2C36B-B748-4080-ADED-78EC98B3331C@gmail-com%3e</id>
<updated>2009-12-01T22:01:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On 02/12/2009, at 5:09 AM, Weddle, Anthony wrote:

&gt; The confusing thing, in this exchange is why Lachlan would be concerned about an object
which, on the face of it, should never have been constructed (since it was created and then
deleted, before it was ever persisted), or why he would want to create objects to replace
those that had been deleted.

Perhaps a real example will help clear up any confusion here. This is for ROP, btw.

So we have an interface which presents to the user a Payslip with a series of (i.e., toMany)
paylines. Depending on the information supplied per-line the line will either be discarded
or included. Unlike the web (at least web 1.0) this state can toggle frequently.

Now, without creating objects in the first place you both have nothing to validate (validateForSave)
nor can you roll-back changes (should this have been a previously persisted object). In either
case, the controller/ui doesn't care...

&gt; From the program's point of view, it's clear that TRANSIENT can be treated exactly the
same as DELETED, since they both mean that some persistable object previously created in the
program has subsequently been deleted by the program.

My point (and clarifying question, however) is that if TRANSIENT does not always mean that
... and it's possible for objects to be transient in other ways then that's not good enough.
It'll do for now - but I'd like to put code in the entity that works in all circumstances
and not just for this particular case.

&gt; From the database's point of view, the states can't be treated the same way; the DELETED
object has to be deleted from the database, the TRANSIENT object was never in the database
and can be ignored.

That's the easy part, sure. But from user-code's point of view, we don't care about the database.
It's an abstraction. :-) Thinking in terms of the database when using an orm ain't best practice
(of course you need to at times). Think in terms of objects.

with regards,
--

Lachlan Deck



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: delete new --&gt; transient?</title>
<author><name>&quot;Weddle, Anthony&quot; &lt;Anthony.Weddle@bluescopesteel.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c1186BC7DC14A424D80E97A63D8517A861952EEE19D@STLAKLXCH02.nzsakl.bhp.com.au%3e"/>
<id>urn:uuid:%3c1186BC7DC14A424D80E97A63D8517A861952EEE19D@STLAKLXCH02-nzsakl-bhp-com-au%3e</id>
<updated>2009-12-01T18:09:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The confusing thing, in this exchange is why Lachlan would be concerned about an object which,
on the face of it, should never have been constructed (since it was created and then deleted,
before it was ever persisted), or why he would want to create objects to replace those that
had been deleted.

&gt;From the program's point of view, it's clear that TRANSIENT can be treated exactly the
same as DELETED, since they both mean that some persistable object previously created in the
program has subsequently been deleted by the program. From the database's point of view, the
states can't be treated the same way; the DELETED object has to be deleted from the database,
the TRANSIENT object was never in the database and can be ignored.

Tony



NOTICE - This message and any attached files may contain information that is confidential,
legally privileged or proprietary. It is intended only for use by the intended recipient.
If you are not the intended recipient or the person responsible for delivering the message
to the intended recipient, be advised that you have received this message in error. Any dissemination,
copying, use or re-transmission of this message or attachment, or the disclosure of any information
therein, is strictly forbidden. BlueScope Steel Limited does not represent or guarantee that
this message or attachment is free of errors, virus or interference.

If you have received this message in error please notify the sender immediately and delete
the message. Any views expressed in this email are not necessarily the views of BlueScope
Steel Limited.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: delete new --&gt; transient?</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200912.mbox/%3c5adb61290912010654u5ec65856x86f18792ac779533@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290912010654u5ec65856x86f18792ac779533@mail-gmail-com%3e</id>
<updated>2009-12-01T14:54:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Mon, Nov 30, 2009 at 5:40 PM, Lachlan Deck &lt;lachlan.deck@gmail.com&gt; wrote:
&gt; On 28/11/2009, at 2:01 AM, Michael Gentry wrote:
&gt;&gt; On Thu, Nov 26, 2009 at 12:52 PM, Lachlan Deck &lt;lachlan.deck@gmail.com&gt; wrote:
&gt;&gt;&gt; But this still means that there's no 'general purpose' method that I'm aware
of (e.g., in Cayenne 'the new static helper' ... ah, see, if you'd called it CayenneUtils
or PersistentUtils there'd be no need for further clarification of what Cayenne refers to
via email ;-)  which answers the basic question: 'is this object marked for deletion (regardless
of whether it was previously persisted)?'
&gt;&gt;
&gt;&gt; Well, an object should only be marked for deletion if it needs to be
&gt;&gt; deleted (it exists in the DB).
&gt;
&gt; This all depends on what 'deleted' means. If deleted were strictly for persisted objects
as you suggest then why is deleteObject the method used to make transient those objects for
which the action of deleting does not apply?


The DataContext doesn't require the user to figure out if an object
has been persisted before they call deleteObject() on it.  Nor does
the DataContext throw an exception if they call deleteObject() on a
NEW object.  The user clearly specified they no longer wanted the
object to be stored by calling deleteObject() so the DataContext marks
it as TRANSIENT if it has never been persisted or DELETED if it has
been persisted.  The commitChanges() will ignore the TRANSIENT objects
in the DataContext.


&gt; The problem is that you cannot tell the difference between deleted transients and non-deleted
transients by looking at its state. Is there something in the framework that tells me that
an object was previously added to the context but was afterwards 'deleted' from it and is
now marked as transient?


I'm not exactly sure why you care if the TRANSIENT object had
deleteObject() called on it or not.  In general practice, though, the
object will not be TRANSIENT *unless* you call deleteObject() on it
and it is a brand new object.  One typically does not call
setPersistenceState() on objects.  And one typically creates the
object inside the DataContext (calling newObject()), which gives it a
NEW state initially.  If it has a persistence state of DELETED, you
know it was previously persisted.


&gt;&gt;&gt; I simply want to know if an object is marked for deletion within the context.
It should be simple like the question itself. :)    And to answer the question, because I
need to know at a later point whether to replace the object with a new one.


An object is marked for deletion, from the physical database, if the
persistence state is DELETED.


&gt;&gt; If an object's persistence state is set to DELETED,
&gt;&gt; then the DC knows it needs to issue a DELETE to the DB on
&gt;&gt; commitChanges()
&gt;
&gt; Are you saying that it has no knowledge otherwise as to whether the object was previously
persisted?
&gt;
&gt; It could also 'know' that if an object's persistence state is set to deleted and the
object was not previously persisted then it issues no sql. :-)


The persistence state variable is used to identify this information.
TRANSIENT = not persisted (or persistable).


&gt; As I understand it, an OC exists to abstract parent object stores from the user.. where
that parent object store may or may not necessarily be a database. But this is all besides
the point.


The ObjectContext/DataContext does more than abstract the backing
store.  It provides a workspace or sandbox for changes to be made and
then manages those changes within a transaction.  If you throw away
the context, no changes are done.  To me it is more like checking out
code from a repository (such as Subversion) into a workarea.  You can
checkout as many workareas (or contexts -- one or more for each user)
as you want and make changes in them, but unless you commit them, the
repository (or database) doesn't get updated and no one else will see
those changes.


&gt; I'm just asking the question as to whether cayenne provides the information I'm after.


I think Cayenne, especially in practical terms, tells you what you want.

Hope that helps somewhat ...

mrg


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: delete new --&gt; transient?</title>
<author><name>Lachlan Deck &lt;lachlan.deck@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3cFB8B4090-AD19-42FF-B298-8E71DF119F0B@gmail.com%3e"/>
<id>urn:uuid:%3cFB8B4090-AD19-42FF-B298-8E71DF119F0B@gmail-com%3e</id>
<updated>2009-11-30T22:40:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On 28/11/2009, at 2:01 AM, Michael Gentry wrote:

&gt; On Thu, Nov 26, 2009 at 12:52 PM, Lachlan Deck &lt;lachlan.deck@gmail.com&gt; wrote:
&gt;&gt; On 27/11/2009, at 2:24 AM, Andrey Razumovsky wrote:
&gt;&gt; 
&gt;&gt;&gt; Because for deleted objects DELETE query will be forced, and if you create
&gt;&gt;&gt; (register), then delete (unregister) an object it looks like as if it was
&gt;&gt;&gt; never registered in context.
&gt;&gt; 
&gt;&gt; This seems (to me, at least) to be implementation details of the framework that's
overly exposed to general users ('cause you have to know the implementation details in order
to make any use of those persistence states in any meaningful way.... e.g., what does transient
mean? Well it depends.... What does deleted mean? Again it depends on other conditions.).
Perhaps then PersistenceState should be private to the framework.
&gt; 
&gt; Sometimes application code needs access to this and making it private
&gt; wouldn't help that matter.

Sure - it can be convenient to have access to internals.

&gt;&gt; But this still means that there's no 'general purpose' method that I'm aware of (e.g.,
in Cayenne 'the new static helper' ... ah, see, if you'd called it CayenneUtils or PersistentUtils
there'd be no need for further clarification of what Cayenne refers to via email ;-)  which
answers the basic question: 'is this object marked for deletion (regardless of whether it
was previously persisted)?'
&gt; 
&gt; Well, an object should only be marked for deletion if it needs to be
&gt; deleted (it exists in the DB).

This all depends on what 'deleted' means. If deleted were strictly for persisted objects as
you suggest then why is deleteObject the method used to make transient those objects for which
the action of deleting does not apply?

&gt; So Cayenne is working properly in this
&gt; regard.

I'm not suggesting it's not behaving as expected.

&gt; If an object has never been persisted (does NOT exist in the
&gt; DB), then it is marked as transient if you delete it.

The problem is that you cannot tell the difference between deleted transients and non-deleted
transients by looking at its state. Is there something in the framework that tells me that
an object was previously added to the context but was afterwards 'deleted' from it and is
now marked as transient?

&gt;&gt; I simply want to know if an object is marked for deletion within the context. It
should be simple like the question itself. :)    And to answer the question, because I need
to know at a later point whether to replace the object with a new one.
&gt; 
&gt; By context I assume you mean data/object context.

Correct.

&gt; My previous comment
&gt; still applies.  :-)  The DataContext needs to know what to do when you
&gt; commitChanges().

Of course it does.

&gt; If an object's persistence state is set to DELETED,
&gt; then the DC knows it needs to issue a DELETE to the DB on
&gt; commitChanges()

Are you saying that it has no knowledge otherwise as to whether the object was previously
persisted?

It could also 'know' that if an object's persistence state is set to deleted and the object
was not previously persisted then it issues no sql. :-)

&gt; Here is TRANSIENT:
&gt; 
&gt;    /**
&gt;     * Describes a state of an object not registered with
&gt; DataContext/ObjectContext, and
&gt;     * therefore having no persistence features.
&gt;     */
&gt;    public static final int TRANSIENT = 1;
&gt; 
&gt; If you register an object with a DC and then delete it (without ever
&gt; persisting it), then it becomes TRANSIENT.  If you register an object
&gt; with a DC, commit it, then delete it, it becomes DELETED.  Keep in
&gt; mind the DC exists to manage your objects for committing changes to
&gt; the DB, not to track general Java usage (such as removing an object
&gt; from a collection).

As I understand it, an OC exists to abstract parent object stores from the user.. where that
parent object store may or may not necessarily be a database. But this is all besides the
point. 

I'm just asking the question as to whether cayenne provides the information I'm after.

with regards,
--

Lachlan Deck



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Exception Deleting DataObject with to-many relationship</title>
<author><name>Joe Baldwin &lt;jfbaldwin@earthlink.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3cFD544167-A010-4926-BB0D-87B4C4AEF28C@earthlink.net%3e"/>
<id>urn:uuid:%3cFD544167-A010-4926-BB0D-87B4C4AEF28C@earthlink-net%3e</id>
<updated>2009-11-27T16:34:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Michael,

&gt; I was just trying to figure out where the salesOrderList property was in your model,
per this error:


Good point.  There is a SalesOrderList Relationship defined for the the Customer record (with
a reverse relationship of Customer).

I checked the ObjEntity config for the Customer and here is the entry

	Name: salesOrderList
	Target:  SalesOrder
	Sematics: to many, list
	Delete Rule: Nullify
	Used For Locking: not checked

I set the Delete rule to "Nullify" thinking that there may come a time to delete the Customer
record while retaining the SalesOrder record.  (Also I noticed that the Delete Rule for the
SaleOrder - orderitemList is set to "Cascade", but MySQL doesn't seem to want to cascade delete
the OrderItems when I delete a SalesOrder).

I would expect from my understanding of the Modeler is that when a Customer is deleted via
Cayenne, that the SalesOrder - customerOID would be set to null.

Thanks,
Joe






On Nov 27, 2009, at 10:38 AM, Michael Gentry wrote:

&gt; Hi Joe,
&gt; 
&gt; I was just trying to figure out where the salesOrderList property was
&gt; in your model, per this error:
&gt; 
&gt;    Error unsetting to-many DataObject property: salesOrderList
&gt; 
&gt; I can't tell if that is in SalesOrder or OrderItem and it doesn't seem
&gt; to match salesOrder.getOrderItemList().
&gt; 
&gt; Thanks,
&gt; 
&gt; mrg
&gt; 
&gt; 
&gt; On Fri, Nov 27, 2009 at 10:29 AM, Joe Baldwin &lt;jfbaldwin@earthlink.net&gt; wrote:
&gt;&gt; Michael,
&gt;&gt; 
&gt;&gt; 
&gt;&gt;&gt; Is childList the same as salesOrderList?
&gt;&gt; 
&gt;&gt; Sorry, I am not sure what you mean by "the same".
&gt;&gt; 
&gt;&gt; If you are asking is the entity self-referential, then the answer is no.  The parent
is named "SalesOrder" and the child is "OrderItem". It is a simple "to-many" relationship
(one sales-order to many order-items).
&gt;&gt; 
&gt;&gt; More info:
&gt;&gt; I did some more testing and found that the problem is associated with older SalesOrders
stored in the production server and seems to be creating an Exception on
&gt;&gt; 
&gt;&gt;        objectContext.deleteObjects(salesOrder.getOrderItemList())
&gt;&gt; 
&gt;&gt; However, when I create a SalesOrder with new data, I cannot duplicate the Exception
condition. So perhaps the Exception is somehow associated with the older data.
&gt;&gt; 
&gt;&gt; Also, I wrote my own "deleteObjects" method (for debugging purposes) and it appears
to work fine with the new SalesOrders or seemingly as well the ObjectContext version and generated
the same Exception with the older data.
&gt;&gt; 
&gt;&gt; The complication with debugging this issue is that the data is on the production
server and once I attempt a test (even though it claims that it failed) the data is actually
deleted, so I can't duplicate the test once all the data is deleted.
&gt;&gt; 
&gt;&gt; Thanks,
&gt;&gt; Joe
&gt;&gt; 
&gt;&gt; 
&gt;&gt; 
&gt;&gt; On Nov 27, 2009, at 10:03 AM, Michael Gentry wrote:
&gt;&gt; 
&gt;&gt;&gt; Is childList the same as salesOrderList?
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; On Thu, Nov 26, 2009 at 6:29 PM, Joe Baldwin &lt;jfbaldwin@earthlink.net&gt;
wrote:
&gt;&gt;&gt;&gt; I am getting an odd exception when I attempt to delete a DataObject with
a "to-many" (aka child list).
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Here is the pseudo code:
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; 1. deleteObjects(parent.getChildList())
&gt;&gt;&gt;&gt; 2. deleteObject(parent)
&gt;&gt;&gt;&gt; 3. objectContext.commitChanges()
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; on Exception
&gt;&gt;&gt;&gt;        objectcontext.rollbackChanges()
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; It is very odd but I am getting the following error:
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; org.apache.cayenne.reflect.PropertyException:
&gt;&gt;&gt;&gt; [v.3.0B1 Nov 03 2009 19:16:06]
&gt;&gt;&gt;&gt; Error unsetting to-many DataObject property: salesOrderList
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; But it is deleting all the associated database rows.
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Am I missing a step in the delete procedure?
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; thanks,
&gt;&gt;&gt;&gt; Joe
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; 
&gt;&gt; 
&gt;&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Exception Deleting DataObject with to-many relationship</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c5adb61290911270738q39f790d1o6a796c0bff343d28@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290911270738q39f790d1o6a796c0bff343d28@mail-gmail-com%3e</id>
<updated>2009-11-27T15:38:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Joe,

I was just trying to figure out where the salesOrderList property was
in your model, per this error:

    Error unsetting to-many DataObject property: salesOrderList

I can't tell if that is in SalesOrder or OrderItem and it doesn't seem
to match salesOrder.getOrderItemList().

Thanks,

mrg


On Fri, Nov 27, 2009 at 10:29 AM, Joe Baldwin &lt;jfbaldwin@earthlink.net&gt; wrote:
&gt; Michael,
&gt;
&gt;
&gt;&gt; Is childList the same as salesOrderList?
&gt;
&gt; Sorry, I am not sure what you mean by "the same".
&gt;
&gt; If you are asking is the entity self-referential, then the answer is no.  The parent
is named "SalesOrder" and the child is "OrderItem". It is a simple "to-many" relationship
(one sales-order to many order-items).
&gt;
&gt; More info:
&gt; I did some more testing and found that the problem is associated with older SalesOrders
stored in the production server and seems to be creating an Exception on
&gt;
&gt;        objectContext.deleteObjects(salesOrder.getOrderItemList())
&gt;
&gt; However, when I create a SalesOrder with new data, I cannot duplicate the Exception condition.
So perhaps the Exception is somehow associated with the older data.
&gt;
&gt; Also, I wrote my own "deleteObjects" method (for debugging purposes) and it appears to
work fine with the new SalesOrders or seemingly as well the ObjectContext version and generated
the same Exception with the older data.
&gt;
&gt; The complication with debugging this issue is that the data is on the production server
and once I attempt a test (even though it claims that it failed) the data is actually deleted,
so I can't duplicate the test once all the data is deleted.
&gt;
&gt; Thanks,
&gt; Joe
&gt;
&gt;
&gt;
&gt; On Nov 27, 2009, at 10:03 AM, Michael Gentry wrote:
&gt;
&gt;&gt; Is childList the same as salesOrderList?
&gt;&gt;
&gt;&gt;
&gt;&gt; On Thu, Nov 26, 2009 at 6:29 PM, Joe Baldwin &lt;jfbaldwin@earthlink.net&gt; wrote:
&gt;&gt;&gt; I am getting an odd exception when I attempt to delete a DataObject with a "to-many"
(aka child list).
&gt;&gt;&gt;
&gt;&gt;&gt; Here is the pseudo code:
&gt;&gt;&gt;
&gt;&gt;&gt; 1. deleteObjects(parent.getChildList())
&gt;&gt;&gt; 2. deleteObject(parent)
&gt;&gt;&gt; 3. objectContext.commitChanges()
&gt;&gt;&gt;
&gt;&gt;&gt; on Exception
&gt;&gt;&gt;        objectcontext.rollbackChanges()
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; It is very odd but I am getting the following error:
&gt;&gt;&gt;
&gt;&gt;&gt; org.apache.cayenne.reflect.PropertyException:
&gt;&gt;&gt; [v.3.0B1 Nov 03 2009 19:16:06]
&gt;&gt;&gt; Error unsetting to-many DataObject property: salesOrderList
&gt;&gt;&gt;
&gt;&gt;&gt; But it is deleting all the associated database rows.
&gt;&gt;&gt;
&gt;&gt;&gt; Am I missing a step in the delete procedure?
&gt;&gt;&gt;
&gt;&gt;&gt; thanks,
&gt;&gt;&gt; Joe
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Exception Deleting DataObject with to-many relationship</title>
<author><name>Joe Baldwin &lt;jfbaldwin@earthlink.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c12656A6A-13F9-43FD-AB08-253913B933D0@earthlink.net%3e"/>
<id>urn:uuid:%3c12656A6A-13F9-43FD-AB08-253913B933D0@earthlink-net%3e</id>
<updated>2009-11-27T15:29:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Michael,


&gt; Is childList the same as salesOrderList?

Sorry, I am not sure what you mean by "the same".

If you are asking is the entity self-referential, then the answer is no.  The parent is named
"SalesOrder" and the child is "OrderItem". It is a simple "to-many" relationship (one sales-order
to many order-items).

More info:
I did some more testing and found that the problem is associated with older SalesOrders stored
in the production server and seems to be creating an Exception on

	objectContext.deleteObjects(salesOrder.getOrderItemList())

However, when I create a SalesOrder with new data, I cannot duplicate the Exception condition.
So perhaps the Exception is somehow associated with the older data.

Also, I wrote my own "deleteObjects" method (for debugging purposes) and it appears to work
fine with the new SalesOrders or seemingly as well the ObjectContext version and generated
the same Exception with the older data.

The complication with debugging this issue is that the data is on the production server and
once I attempt a test (even though it claims that it failed) the data is actually deleted,
so I can't duplicate the test once all the data is deleted.

Thanks,
Joe



On Nov 27, 2009, at 10:03 AM, Michael Gentry wrote:

&gt; Is childList the same as salesOrderList?
&gt; 
&gt; 
&gt; On Thu, Nov 26, 2009 at 6:29 PM, Joe Baldwin &lt;jfbaldwin@earthlink.net&gt; wrote:
&gt;&gt; I am getting an odd exception when I attempt to delete a DataObject with a "to-many"
(aka child list).
&gt;&gt; 
&gt;&gt; Here is the pseudo code:
&gt;&gt; 
&gt;&gt; 1. deleteObjects(parent.getChildList())
&gt;&gt; 2. deleteObject(parent)
&gt;&gt; 3. objectContext.commitChanges()
&gt;&gt; 
&gt;&gt; on Exception
&gt;&gt;        objectcontext.rollbackChanges()
&gt;&gt; 
&gt;&gt; 
&gt;&gt; It is very odd but I am getting the following error:
&gt;&gt; 
&gt;&gt; org.apache.cayenne.reflect.PropertyException:
&gt;&gt; [v.3.0B1 Nov 03 2009 19:16:06]
&gt;&gt; Error unsetting to-many DataObject property: salesOrderList
&gt;&gt; 
&gt;&gt; But it is deleting all the associated database rows.
&gt;&gt; 
&gt;&gt; Am I missing a step in the delete procedure?
&gt;&gt; 
&gt;&gt; thanks,
&gt;&gt; Joe
&gt;&gt; 
&gt;&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Exception Deleting DataObject with to-many relationship</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c5adb61290911270703l76bfcefdr2d88fd71b4fb69e6@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290911270703l76bfcefdr2d88fd71b4fb69e6@mail-gmail-com%3e</id>
<updated>2009-11-27T15:03:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Is childList the same as salesOrderList?


On Thu, Nov 26, 2009 at 6:29 PM, Joe Baldwin &lt;jfbaldwin@earthlink.net&gt; wrote:
&gt; I am getting an odd exception when I attempt to delete a DataObject with a "to-many"
(aka child list).
&gt;
&gt; Here is the pseudo code:
&gt;
&gt; 1. deleteObjects(parent.getChildList())
&gt; 2. deleteObject(parent)
&gt; 3. objectContext.commitChanges()
&gt;
&gt; on Exception
&gt;        objectcontext.rollbackChanges()
&gt;
&gt;
&gt; It is very odd but I am getting the following error:
&gt;
&gt; org.apache.cayenne.reflect.PropertyException:
&gt; [v.3.0B1 Nov 03 2009 19:16:06]
&gt; Error unsetting to-many DataObject property: salesOrderList
&gt;
&gt; But it is deleting all the associated database rows.
&gt;
&gt; Am I missing a step in the delete procedure?
&gt;
&gt; thanks,
&gt; Joe
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: delete new --&gt; transient?</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c5adb61290911270701x542309e5ob103a12b48968bd9@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290911270701x542309e5ob103a12b48968bd9@mail-gmail-com%3e</id>
<updated>2009-11-27T15:01:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Thu, Nov 26, 2009 at 12:52 PM, Lachlan Deck &lt;lachlan.deck@gmail.com&gt; wrote:
&gt; On 27/11/2009, at 2:24 AM, Andrey Razumovsky wrote:
&gt;
&gt;&gt; Because for deleted objects DELETE query will be forced, and if you create
&gt;&gt; (register), then delete (unregister) an object it looks like as if it was
&gt;&gt; never registered in context.
&gt;
&gt; This seems (to me, at least) to be implementation details of the framework that's overly
exposed to general users ('cause you have to know the implementation details in order to make
any use of those persistence states in any meaningful way.... e.g., what does transient mean?
Well it depends.... What does deleted mean? Again it depends on other conditions.). Perhaps
then PersistenceState should be private to the framework.


Sometimes application code needs access to this and making it private
wouldn't help that matter.


&gt; But this still means that there's no 'general purpose' method that I'm aware of (e.g.,
in Cayenne 'the new static helper' ... ah, see, if you'd called it CayenneUtils or PersistentUtils
there'd be no need for further clarification of what Cayenne refers to via email ;-)  which
answers the basic question: 'is this object marked for deletion (regardless of whether it
was previously persisted)?'


Well, an object should only be marked for deletion if it needs to be
deleted (it exists in the DB).  So Cayenne is working properly in this
regard.  If an object has never been persisted (does NOT exist in the
DB), then it is marked as transient if you delete it.


&gt; I simply want to know if an object is marked for deletion within the context. It should
be simple like the question itself. :)    And to answer the question, because I need to know
at a later point whether to replace the object with a new one.


By context I assume you mean data/object context.  My previous comment
still applies.  :-)  The DataContext needs to know what to do when you
commitChanges().  If an object's persistence state is set to DELETED,
then the DC knows it needs to issue a DELETE to the DB on
commitChanges() (TRANSIENT objects will not be persisted).  The
JavaDoc even specifies this:

    /**
     * Describes a state of an object registered with
DataContext/ObjectContext, that will
     * be deleted from the database on the next commit.
     */
    public static final int DELETED = 6;

Here is TRANSIENT:

    /**
     * Describes a state of an object not registered with
DataContext/ObjectContext, and
     * therefore having no persistence features.
     */
    public static final int TRANSIENT = 1;

If you register an object with a DC and then delete it (without ever
persisting it), then it becomes TRANSIENT.  If you register an object
with a DC, commit it, then delete it, it becomes DELETED.  Keep in
mind the DC exists to manage your objects for committing changes to
the DB, not to track general Java usage (such as removing an object
from a collection).

mrg


</pre>
</div>
</content>
</entry>
<entry>
<title>Exception Deleting DataObject with to-many relationship</title>
<author><name>Joe Baldwin &lt;jfbaldwin@earthlink.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3cAA805933-3BB8-4EBE-B25A-6B6A4E2FD108@earthlink.net%3e"/>
<id>urn:uuid:%3cAA805933-3BB8-4EBE-B25A-6B6A4E2FD108@earthlink-net%3e</id>
<updated>2009-11-26T23:29:08Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am getting an odd exception when I attempt to delete a DataObject with a "to-many" (aka child
list).

Here is the pseudo code:

1. deleteObjects(parent.getChildList())
2. deleteObject(parent)
3. objectContext.commitChanges()

on Exception
	objectcontext.rollbackChanges()


It is very odd but I am getting the following error:

org.apache.cayenne.reflect.PropertyException: 
[v.3.0B1 Nov 03 2009 19:16:06]
Error unsetting to-many DataObject property: salesOrderList

But it is deleting all the associated database rows.

Am I missing a step in the delete procedure?

thanks,
Joe



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: delete new --&gt; transient?</title>
<author><name>Lachlan Deck &lt;lachlan.deck@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c0C027011-5F08-4FD5-A6D2-8B2861DFE710@gmail.com%3e"/>
<id>urn:uuid:%3c0C027011-5F08-4FD5-A6D2-8B2861DFE710@gmail-com%3e</id>
<updated>2009-11-26T17:52:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On 27/11/2009, at 2:24 AM, Andrey Razumovsky wrote:

&gt; Because for deleted objects DELETE query will be forced, and if you create
&gt; (register), then delete (unregister) an object it looks like as if it was
&gt; never registered in context.

This seems (to me, at least) to be implementation details of the framework that's overly exposed
to general users ('cause you have to know the implementation details in order to make any
use of those persistence states in any meaningful way.... e.g., what does transient mean?
Well it depends.... What does deleted mean? Again it depends on other conditions.). Perhaps
then PersistenceState should be private to the framework.

But this still means that there's no 'general purpose' method that I'm aware of (e.g., in
Cayenne 'the new static helper' ... ah, see, if you'd called it CayenneUtils or PersistentUtils
there'd be no need for further clarification of what Cayenne refers to via email ;-)  which
answers the basic question: 'is this object marked for deletion (regardless of whether it
was previously persisted)?'

&gt; Why you need such testing?

I simply want to know if an object is marked for deletion within the context. It should be
simple like the question itself. :)    And to answer the question, because I need to know
at a later point whether to replace the object with a new one.

i.e., there's basic questions that are generally useful:
isNew, isModified, isDeleted.

&gt; Currently I can think only of quite nasty
&gt; workaround on ROP 3.0 - using custom contexts and overriding deleteObject()

I ended up having to do:
public boolean isDeleted() {
	return
	getObjectContext() == null
	|| getObjectContext().deletedObjects().contains(this)
	|| !getObjectContext().getGraphManager().registeredNodes().contains(getRecord());
}

It's a bit unintuitive imho for deletedObjects to not contain these things ... for surely
they could be dealt with (i.e., treated as unregistered) during the saveChanges operations
should an object be both new and deleted(?)....

&gt; 2009/11/26 Lachlan Deck &lt;lachlan.deck@gmail.com&gt;
&gt; 
&gt;&gt; Hi there,
&gt;&gt; 
&gt;&gt; just wondering why when deleting a new object that its status is being set
&gt;&gt; to PeristenceState.TRANSIENT rather than DELETED?
&gt;&gt; 
&gt;&gt; @see ObjectContextDeleteAction#deleteNew(Persistent)
&gt;&gt; It also doesn't turn up in context.deletedObjects
&gt;&gt; 
&gt;&gt; So this all seems to make it more difficult to determine the state of an
&gt;&gt; object.
&gt;&gt; 
&gt;&gt; Regardless of the rationale - what's the recommended way of determining if
&gt;&gt; an object is deleted within the context?
&gt;&gt; Thanks.
&gt;&gt; 
&gt;&gt; with regards,
&gt;&gt; --
&gt;&gt; 
&gt;&gt; Lachlan Deck
&gt;&gt; 
&gt;&gt; 
&gt; 
&gt; 
&gt; -- 
&gt; Andrey

with regards,
--

Lachlan Deck





</pre>
</div>
</content>
</entry>
<entry>
<title>Re: delete new --&gt; transient?</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c3219fff70911260724m41d7bf08yd4c4b9f513beceea@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70911260724m41d7bf08yd4c4b9f513beceea@mail-gmail-com%3e</id>
<updated>2009-11-26T15:24:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Because for deleted objects DELETE query will be forced, and if you create
(register), then delete (unregister) an object it looks like as if it was
never registered in context.
Why you need such testing? Currently I can think only of quite nasty
workaround on ROP 3.0 - using custom contexts and overriding deleteObject()

2009/11/26 Lachlan Deck &lt;lachlan.deck@gmail.com&gt;

&gt; Hi there,
&gt;
&gt; just wondering why when deleting a new object that its status is being set
&gt; to PeristenceState.TRANSIENT rather than DELETED?
&gt;
&gt; @see ObjectContextDeleteAction#deleteNew(Persistent)
&gt; It also doesn't turn up in context.deletedObjects
&gt;
&gt; So this all seems to make it more difficult to determine the state of an
&gt; object.
&gt;
&gt; Regardless of the rationale - what's the recommended way of determining if
&gt; an object is deleted within the context?
&gt; Thanks.
&gt;
&gt; with regards,
&gt; --
&gt;
&gt; Lachlan Deck
&gt;
&gt;


-- 
Andrey


</pre>
</div>
</content>
</entry>
<entry>
<title>delete new --&gt; transient?</title>
<author><name>Lachlan Deck &lt;lachlan.deck@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3cE1EB8C33-3F21-4061-9149-5EBA46F7C7F7@gmail.com%3e"/>
<id>urn:uuid:%3cE1EB8C33-3F21-4061-9149-5EBA46F7C7F7@gmail-com%3e</id>
<updated>2009-11-26T01:33:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi there,

just wondering why when deleting a new object that its status is being set to PeristenceState.TRANSIENT
rather than DELETED?

@see ObjectContextDeleteAction#deleteNew(Persistent)
It also doesn't turn up in context.deletedObjects

So this all seems to make it more difficult to determine the state of an object.

Regardless of the rationale - what's the recommended way of determining if an object is deleted
within the context?
Thanks.

with regards,
--

Lachlan Deck



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Temporary ID hasn't been replaced on commit</title>
<author><name>Michael Gentry &lt;mgentry@masslight.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c5adb61290911250553i60733d95m4da535debcd43e88@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5adb61290911250553i60733d95m4da535debcd43e88@mail-gmail-com%3e</id>
<updated>2009-11-25T13:53:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Wed, Nov 25, 2009 at 8:47 AM, Juergen Saar &lt;juergen@jsaar.org&gt; wrote:
&gt; For using 3.0 in productive environment ... Is there a time-scale for the
&gt; final 3.0?

There isn't a final date, but hope to have it out soon.  However, I
don't think you should let the beta label stop you.  I'm using 3.0B1
in something I plan to deploy in production (was using 3.0M6 prior to
that) and Borut just posted to the list about a large-scale effort in
which he used 3.0 (not sure which tag) to deploy to production.  There
might be a few issues lurking, but it seems pretty stable overall and
we are looking for feedback from the user community to iron out any
remaining issues and release the final version.

Thanks,

mrg


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Temporary ID hasn't been replaced on commit</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c8CAD5803-5F2C-4A9F-9ECF-2946BF5C3E24@objectstyle.org%3e"/>
<id>urn:uuid:%3c8CAD5803-5F2C-4A9F-9ECF-2946BF5C3E24@objectstyle-org%3e</id>
<updated>2009-11-25T13:53:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
As you probably know, we are already in Beta and Cayenne runtime  
framework code is frozen. So it is 100% stable from the API  
perspective. And after 1 or 2 intermediate releases it becomes final.  
Timewise, I don't know, maybe a couple of months?

Andrus

On Nov 25, 2009, at 3:47 PM, Juergen Saar wrote:

&gt; I'm in preparations for 3.0 ... but there was a lot of trouble this  
&gt; year, so
&gt; I didn't get as far as I planned ...
&gt;
&gt; For using 3.0 in productive environment ... Is there a time-scale  
&gt; for the
&gt; final 3.0?
&gt;
&gt;
&gt; 2009/11/25 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;
&gt;&gt; Do you have an option of trying this with 3.0? There were a few bug  
&gt;&gt; fixes
&gt;&gt; related to unstable data types in ObjectIds (e.g. the same ID can  
&gt;&gt; have a PK
&gt;&gt; mapping as a BigDecimal or Integer depending on how object was  
&gt;&gt; obtained).
&gt;&gt; Could be something related.
&gt;&gt;
&gt;&gt; Andrus
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; On Nov 25, 2009, at 10:32 AM, Juergen Saar wrote:
&gt;&gt;
&gt;&gt; I'm using Version 2.0.4 ...
&gt;&gt;&gt;
&gt;&gt;&gt; 2009/11/25 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Don't yet know what might be causing it, but what version of  
&gt;&gt;&gt; Cayenne are
&gt;&gt;&gt;&gt; you using?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Andrus
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; On Nov 25, 2009, at 9:49 AM, Juergen Saar wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Hi,
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; we're using cayenne for the web-interface of a 20 year old  
&gt;&gt;&gt;&gt;&gt; project with
&gt;&gt;&gt;&gt;&gt; meaningful keys. We don't use tapestry. The keys are handled in  
&gt;&gt;&gt;&gt;&gt; the
&gt;&gt;&gt;&gt;&gt; validateForSave().
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; In some cases after commit there is an Exception: "Temporary ID  
&gt;&gt;&gt;&gt;&gt; hasn't
&gt;&gt;&gt;&gt;&gt; been
&gt;&gt;&gt;&gt;&gt; replaced on commit"
&gt;&gt;&gt;&gt;&gt; The values of the Dataobject are OK and the Informations put to  
&gt;&gt;&gt;&gt;&gt; database
&gt;&gt;&gt;&gt;&gt; are
&gt;&gt;&gt;&gt;&gt; correct.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; In the Objects that cause this Exception I can't see any  
&gt;&gt;&gt;&gt;&gt; difference to
&gt;&gt;&gt;&gt;&gt; Objects that don't cause this Execption.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Is there anything I can do to force the replacement if the Temp  
&gt;&gt;&gt;&gt;&gt; ID or to
&gt;&gt;&gt;&gt;&gt; prevent this Exception?
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Caching in cayenne is disabled, because there are many other
&gt;&gt;&gt;&gt;&gt; applications
&gt;&gt;&gt;&gt;&gt; also manipulating data in database.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Any hint would help ...
&gt;&gt;&gt;&gt;&gt; -Juergen-
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Temporary ID hasn't been replaced on commit</title>
<author><name>Juergen Saar &lt;juergen@jsaar.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3ce0b37ed50911250547o62da092dr7d70c74cc23e177e@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce0b37ed50911250547o62da092dr7d70c74cc23e177e@mail-gmail-com%3e</id>
<updated>2009-11-25T13:47:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm in preparations for 3.0 ... but there was a lot of trouble this year, so
I didn't get as far as I planned ...

For using 3.0 in productive environment ... Is there a time-scale for the
final 3.0?


2009/11/25 Andrus Adamchik &lt;andrus@objectstyle.org&gt;

&gt; Do you have an option of trying this with 3.0? There were a few bug fixes
&gt; related to unstable data types in ObjectIds (e.g. the same ID can have a PK
&gt; mapping as a BigDecimal or Integer depending on how object was obtained).
&gt; Could be something related.
&gt;
&gt; Andrus
&gt;
&gt;
&gt;
&gt; On Nov 25, 2009, at 10:32 AM, Juergen Saar wrote:
&gt;
&gt;  I'm using Version 2.0.4 ...
&gt;&gt;
&gt;&gt; 2009/11/25 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;&gt;
&gt;&gt;  Don't yet know what might be causing it, but what version of Cayenne are
&gt;&gt;&gt; you using?
&gt;&gt;&gt;
&gt;&gt;&gt; Andrus
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; On Nov 25, 2009, at 9:49 AM, Juergen Saar wrote:
&gt;&gt;&gt;
&gt;&gt;&gt; Hi,
&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; we're using cayenne for the web-interface of a 20 year old project with
&gt;&gt;&gt;&gt; meaningful keys. We don't use tapestry. The keys are handled in the
&gt;&gt;&gt;&gt; validateForSave().
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; In some cases after commit there is an Exception: "Temporary ID hasn't
&gt;&gt;&gt;&gt; been
&gt;&gt;&gt;&gt; replaced on commit"
&gt;&gt;&gt;&gt; The values of the Dataobject are OK and the Informations put to database
&gt;&gt;&gt;&gt; are
&gt;&gt;&gt;&gt; correct.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; In the Objects that cause this Exception I can't see any difference to
&gt;&gt;&gt;&gt; Objects that don't cause this Execption.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Is there anything I can do to force the replacement if the Temp ID or to
&gt;&gt;&gt;&gt; prevent this Exception?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Caching in cayenne is disabled, because there are many other
&gt;&gt;&gt;&gt; applications
&gt;&gt;&gt;&gt; also manipulating data in database.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Any hint would help ...
&gt;&gt;&gt;&gt; -Juergen-
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Temporary ID hasn't been replaced on commit</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c8DB97F5C-EE48-4026-9101-F65FE7D23288@objectstyle.org%3e"/>
<id>urn:uuid:%3c8DB97F5C-EE48-4026-9101-F65FE7D23288@objectstyle-org%3e</id>
<updated>2009-11-25T13:27:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Do you have an option of trying this with 3.0? There were a few bug  
fixes related to unstable data types in ObjectIds (e.g. the same ID  
can have a PK mapping as a BigDecimal or Integer depending on how  
object was obtained). Could be something related.

Andrus


On Nov 25, 2009, at 10:32 AM, Juergen Saar wrote:

&gt; I'm using Version 2.0.4 ...
&gt;
&gt; 2009/11/25 Andrus Adamchik &lt;andrus@objectstyle.org&gt;
&gt;
&gt;&gt; Don't yet know what might be causing it, but what version of  
&gt;&gt; Cayenne are
&gt;&gt; you using?
&gt;&gt;
&gt;&gt; Andrus
&gt;&gt;
&gt;&gt;
&gt;&gt; On Nov 25, 2009, at 9:49 AM, Juergen Saar wrote:
&gt;&gt;
&gt;&gt; Hi,
&gt;&gt;&gt;
&gt;&gt;&gt; we're using cayenne for the web-interface of a 20 year old project  
&gt;&gt;&gt; with
&gt;&gt;&gt; meaningful keys. We don't use tapestry. The keys are handled in the
&gt;&gt;&gt; validateForSave().
&gt;&gt;&gt;
&gt;&gt;&gt; In some cases after commit there is an Exception: "Temporary ID  
&gt;&gt;&gt; hasn't
&gt;&gt;&gt; been
&gt;&gt;&gt; replaced on commit"
&gt;&gt;&gt; The values of the Dataobject are OK and the Informations put to  
&gt;&gt;&gt; database
&gt;&gt;&gt; are
&gt;&gt;&gt; correct.
&gt;&gt;&gt;
&gt;&gt;&gt; In the Objects that cause this Exception I can't see any  
&gt;&gt;&gt; difference to
&gt;&gt;&gt; Objects that don't cause this Execption.
&gt;&gt;&gt;
&gt;&gt;&gt; Is there anything I can do to force the replacement if the Temp ID  
&gt;&gt;&gt; or to
&gt;&gt;&gt; prevent this Exception?
&gt;&gt;&gt;
&gt;&gt;&gt; Caching in cayenne is disabled, because there are many other  
&gt;&gt;&gt; applications
&gt;&gt;&gt; also manipulating data in database.
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Any hint would help ...
&gt;&gt;&gt; -Juergen-
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Temporary ID hasn't been replaced on commit</title>
<author><name>Juergen Saar &lt;juergen@jsaar.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3ce0b37ed50911250032n498ee4dqad39969a4e4e7c48@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce0b37ed50911250032n498ee4dqad39969a4e4e7c48@mail-gmail-com%3e</id>
<updated>2009-11-25T08:32:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm using Version 2.0.4 ...

2009/11/25 Andrus Adamchik &lt;andrus@objectstyle.org&gt;

&gt; Don't yet know what might be causing it, but what version of Cayenne are
&gt; you using?
&gt;
&gt; Andrus
&gt;
&gt;
&gt; On Nov 25, 2009, at 9:49 AM, Juergen Saar wrote:
&gt;
&gt;  Hi,
&gt;&gt;
&gt;&gt; we're using cayenne for the web-interface of a 20 year old project with
&gt;&gt; meaningful keys. We don't use tapestry. The keys are handled in the
&gt;&gt; validateForSave().
&gt;&gt;
&gt;&gt; In some cases after commit there is an Exception: "Temporary ID hasn't
&gt;&gt; been
&gt;&gt; replaced on commit"
&gt;&gt; The values of the Dataobject are OK and the Informations put to database
&gt;&gt; are
&gt;&gt; correct.
&gt;&gt;
&gt;&gt; In the Objects that cause this Exception I can't see any difference to
&gt;&gt; Objects that don't cause this Execption.
&gt;&gt;
&gt;&gt; Is there anything I can do to force the replacement if the Temp ID or to
&gt;&gt; prevent this Exception?
&gt;&gt;
&gt;&gt; Caching in cayenne is disabled, because there are many other applications
&gt;&gt; also manipulating data in database.
&gt;&gt;
&gt;&gt;
&gt;&gt; Any hint would help ...
&gt;&gt; -Juergen-
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [ANNOUNCEMENT] Success story</title>
<author><name>Andrey Razumovsky &lt;razumovsky.andrey@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c3219fff70911250012r375e5e2aocfdc0895a9b44f67@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3219fff70911250012r375e5e2aocfdc0895a9b44f67@mail-gmail-com%3e</id>
<updated>2009-11-25T08:12:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Also we can update the page [1] with your words

[1] http://cayenne.apache.org/success-stories.html

2009/11/25 Borut BolÄina &lt;borut.bolcina@gmail.com&gt;

&gt; Hello,
&gt;
&gt; I would like to share a Cayenne success story on this list. Four days ago
&gt; we
&gt; launched a renewed site www.najdi.si. It is a search engine site in
&gt; Slovenia
&gt; with over 600.000 visits per day (on the launch day this figure was well
&gt; over million). Users now have the option to register and log in to have the
&gt; benefit of customizing the site with a set of widgets available from the
&gt; library. Over 110.000 registered users at this moment.
&gt;
&gt; The site is in a cluster and the architecture is moving towards REST
&gt; interfaces. The Cayenne is used at almost all levels - getting the data for
&gt; widgets from external resources and later to pump this data to frontend.
&gt;
&gt; All in all it was a good experience and I can only confirm the framework is
&gt; mature enough (3.0) to handle big projects. What I was missing from the
&gt; documentation was good usage patterns, anti patterns and cookbook examples
&gt; for variety of problems. Well, there are no problems, only challenges :-)
&gt;
&gt; Thanks to the Cayenne team for all the effort in developing this framework!
&gt;
&gt; Regards,
&gt; Borut
&gt;
&gt; P.S. My only wish now is that Robert and Kevin (others?) will continue to
&gt; work on the Cayenne-Tapestry5 integration!!!
&gt;



-- 
Andrey


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Temporary ID hasn't been replaced on commit</title>
<author><name>Andrus Adamchik &lt;andrus@objectstyle.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-user/200911.mbox/%3c972CEC6A-8CAC-49A4-A38F-1EAFF0E2332B@objectstyle.org%3e"/>
<id>urn:uuid:%3c972CEC6A-8CAC-49A4-A38F-1EAFF0E2332B@objectstyle-org%3e</id>
<updated>2009-11-25T07:51:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Don't yet know what might be causing it, but what version of Cayenne  
are you using?

Andrus

On Nov 25, 2009, at 9:49 AM, Juergen Saar wrote:

&gt; Hi,
&gt;
&gt; we're using cayenne for the web-interface of a 20 year old project  
&gt; with
&gt; meaningful keys. We don't use tapestry. The keys are handled in the
&gt; validateForSave().
&gt;
&gt; In some cases after commit there is an Exception: "Temporary ID  
&gt; hasn't been
&gt; replaced on commit"
&gt; The values of the Dataobject are OK and the Informations put to  
&gt; database are
&gt; correct.
&gt;
&gt; In the Objects that cause this Exception I can't see any difference to
&gt; Objects that don't cause this Execption.
&gt;
&gt; Is there anything I can do to force the replacement if the Temp ID  
&gt; or to
&gt; prevent this Exception?
&gt;
&gt; Caching in cayenne is disabled, because there are many other  
&gt; applications
&gt; also manipulating data in database.
&gt;
&gt;
&gt; Any hint would help ...
&gt; -Juergen-



</pre>
</div>
</content>
</entry>
</feed>
