Tomi NA | 1 May 11:51 2006
Picon

Re: reverse engineering a postgresql database: no relationships detected?

On 4/30/06, Andrus Adamchik <andrus <at> objectstyle.org> wrote:
>
> On Apr 30, 2006, at 3:39 PM, Andrus Adamchik wrote:
>
> >> Of the top of my head, I can suggest xstream as an (as far as I've
> >> used it) a great serialization engine.
> >
> > Good idea. Serializing preferences to XML may be a better solution.
> > Embedded HSQLDB proved to be too unreliable. And I guess we can use
> > XSLT transforms to version the preferences.
>
> Using Cayenne for preferences is great for a few reasons (1) you can
> do real queries and (2) updates are incremental. I guess if we go
> XML, we'll have to manually partition the preferences into smaller
> manageable chunks and use XPath. Oh well...

Not that I'm against trying new things, but do you know of any other
application storing it's preferences in a database? It seems like a
major overkill to me...but then, I don't know much about the specifics
of the modeler code so take my comments with a grain of salt.

t.n.a.

Andrus Adamchik | 1 May 13:57 2006

Re: reverse engineering a postgresql database: no relationships detected?


On May 1, 2006, at 5:51 AM, Tomi NA wrote:
> Not that I'm against trying new things, but do you know of any other
> application storing it's preferences in a database? It seems like a
> major overkill to me...but then, I don't know much about the specifics
> of the modeler code so take my comments with a grain of salt.
>
> t.n.a.

There is nothing special about the Modeler in this respect. And a  
standalone DB engine would indeed be a major overkill. Embedded DB on  
the other hand seemed like a good option and indeed performed pretty  
well (except for the occasional data corruption...he-he).

Anyways, I was just thinking out loud, as I am trying to find a  
better solution. One more idea - we should stop trying to be fancy  
and stick with Java standard preferences API as a least common  
denominator :-)

Andrus

Tomi NA | 1 May 14:02 2006
Picon

Re: reverse engineering a postgresql database: no relationships detected?

On 5/1/06, Andrus Adamchik <andrus <at> objectstyle.org> wrote:

> Anyways, I was just thinking out loud, as I am trying to find a
> better solution. One more idea - we should stop trying to be fancy
> and stick with Java standard preferences API as a least common
> denominator :-)

As far as I'm concerned, anything that works well (enough). In this
respect, I belive an idea borrowed from Einstein might be a good
guideline here: Make everything as simple as possible, but no simpler.
:)

t.n.a.

RE: reverse engineering a postgresql database: no relationships detected?

Not that this helps, but all proper OS X (Cocoa-based) applications
store their preferences in the defaults database, so yes, that is a
tried and proven idea.  It just seems like HSQLDB (or something) is
getting a bit confused from time-to-time.  I like the XML idea Andrus
mentioned, since it is human readable and editable.  And XML is very
enterprisey.  :-)

/dev/mrg

-----Original Message-----
From: Tomi NA [mailto:hefest <at> gmail.com] 
Sent: Monday, May 01, 2006 5:51 AM
To: cayenne-user <at> incubator.apache.org
Subject: Re: reverse engineering a postgresql database: no relationships
detected?

On 4/30/06, Andrus Adamchik <andrus <at> objectstyle.org> wrote:
>
> On Apr 30, 2006, at 3:39 PM, Andrus Adamchik wrote:
>
> >> Of the top of my head, I can suggest xstream as an (as far as I've
> >> used it) a great serialization engine.
> >
> > Good idea. Serializing preferences to XML may be a better solution.
> > Embedded HSQLDB proved to be too unreliable. And I guess we can use
> > XSLT transforms to version the preferences.
>
> Using Cayenne for preferences is great for a few reasons (1) you can
> do real queries and (2) updates are incremental. I guess if we go
> XML, we'll have to manually partition the preferences into smaller
(Continue reading)

Mike Kienenberger | 2 May 19:06 2006
Picon

Re: java.sql.SQLException: No rows for 'payment_items'

On 4/29/06, Philip Copeland <pcopeland <at> avoka.com> wrote:
> Just tracked this down - its very subtle - and I think qualifies as a
> bug in Cayenne. The problem is that the select for the AutoPKSupport is
> not using
> A fully qualified table name

That sounds reasonable to me.   Open a JIRA issue on it.   I've got
some of the same concerns right now with HSQLDB, but I haven't looked
into them deeply.

Andrus Adamchik | 2 May 19:18 2006

Re: java.sql.SQLException: No rows for 'payment_items'

Yeah, this will be a nice improvement. BTW, PK generator 'schema'  
property is a part of the JPA spec, so we will have to implement it  
anyways.

Andrus

On May 2, 2006, at 1:06 PM, Mike Kienenberger wrote:

> On 4/29/06, Philip Copeland <pcopeland <at> avoka.com> wrote:
>> Just tracked this down - its very subtle - and I think qualifies as a
>> bug in Cayenne. The problem is that the select for the  
>> AutoPKSupport is
>> not using
>> A fully qualified table name
>
> That sounds reasonable to me.   Open a JIRA issue on it.   I've got
> some of the same concerns right now with HSQLDB, but I haven't looked
> into them deeply.
>

Tore Halset | 2 May 19:54 2006
Picon
Picon

Re: java.sql.SQLException: No rows for 'payment_items'


On May 2, 2006, at 19:06, Mike Kienenberger wrote:

> On 4/29/06, Philip Copeland <pcopeland <at> avoka.com> wrote:
>> Just tracked this down - its very subtle - and I think qualifies as a
>> bug in Cayenne. The problem is that the select for the  
>> AutoPKSupport is
>> not using
>> A fully qualified table name
>
> That sounds reasonable to me.   Open a JIRA issue on it.   I've got
> some of the same concerns right now with HSQLDB, but I haven't looked
> into them deeply.

This is also discussed in this old issue.

http://issues.apache.org/cayenne/browse/CAY-72

It is not an issue for me anymore as I am only using a single schema/ 
tablespace/whatever for a single instance of an cayenne app, but it  
should probably be fixed.

  - Tore.

Philip Copeland | 3 May 00:46 2006

RE: java.sql.SQLException: No rows for 'payment_items'

Logged as CAY-539.

Philip 

-----Original Message-----
From: Andrus Adamchik [mailto:andrus <at> objectstyle.org] 
Sent: Wednesday, 3 May 2006 3:18 AM
To: cayenne-user <at> incubator.apache.org
Subject: Re: java.sql.SQLException: No rows for 'payment_items'

Yeah, this will be a nice improvement. BTW, PK generator 'schema'  
property is a part of the JPA spec, so we will have to implement it
anyways.

Andrus

On May 2, 2006, at 1:06 PM, Mike Kienenberger wrote:

> On 4/29/06, Philip Copeland <pcopeland <at> avoka.com> wrote:
>> Just tracked this down - its very subtle - and I think qualifies as a

>> bug in Cayenne. The problem is that the select for the AutoPKSupport 
>> is not using A fully qualified table name
>
> That sounds reasonable to me.   Open a JIRA issue on it.   I've got
> some of the same concerns right now with HSQLDB, but I haven't looked 
> into them deeply.
>

(Continue reading)

Chandni Jain | 3 May 18:52 2006
Picon

Parameterized Query in DataMap

Hello,

I am trying to use Cayenee to connect to mysql database. I wanted to create
a parameterized query and store it in DataMap so I can reuse the query.
Please can you tell me how I should specify the query and how do I map the
parameters.

Currently this is what I am doing: 

In the  datamap 

<query name="ParamDecompQuery"
factory="org.objectstyle.cayenne.map.SQLTemplateBuilder" root="obj-entity"
root-name="DesignModule">

            <sql
adapter-class="org.objectstyle.cayenne.dba.mysql.MySQLAdapter"><![CDATA[SELE
CT m.* FROM

  design_module m

  JOIN design_modulerefinementrelation d ON m.`factid`=d.child AND
m.version=d.version

  JOIN __versions__ v ON m.version=v.id

WHERE version_name=? AND d.parent=?]]></sql>

      </query>

(Continue reading)

Fredrik Liden | 3 May 19:01 2006

Querying join table

I'm trying to figure out two queries from the following structure.

SURVEY
SurveyID  (PK)

PERSON_SURVEY            
PersonID (PK,FK)
SurveyID (PK,FK)

PERSON       
PersonID (PK)

1. I have a join table PERSON_SURVEY with a composite key of PersonID
and SurveyID. How can I query for all the entries where PersonID =
'something'. Do I use an expression or a path? Since this is a composite
key and is part of the PK. In general, is it preferred to stay away from
composite keys in the join tables?

The second one is: Is there any way I can formulate a query that returns
all the entries in the PERSON table that are not mentioned in the
PERSON_SURVEY table for a specific survey. In other words, I'd like to
get a list of people that haven't been assigned anything yet. I'm having
complete brain freeze.

If anyone could spare some time to take a look that would be awesome.

Fredrik


Gmane