Vertical inheritance - subclass associations

2012-04-06 Thread Dave Lamy
Hey guys-- I'm trying to grok the vertical inheritance method and have a question/concern: I tried modeling a couple of tables using the vertical method. I have 3 tables now: ASSET ASSET_MASTER ASSET_VERSION I created everything according to the docs.. Set up properties and relationships at th

Re: DBSchema migration

2011-10-07 Thread Dave Lamy
cl.ly/1V0K3n2w143n05072r2W On Fri, Oct 7, 2011 at 2:33 PM, John Huss wrote: > Thanks, could you give an example or point me to the classes that do this: > "use the ExecutingMergerContext to apply the DB > schema changes." > > On Fri, Oct 7, 2011 at 3:15 PM, Dave Lamy wrote: >

Re: DBSchema migration

2011-10-07 Thread Dave Lamy
I've got runtime schema sync integrated into our codebase. It's essentially a matter of updating the Cayenne model at runtime (via manipulation of DataMap members) and then using the ExecutingMergerContext to apply the DB schema changes. Dave On Fri, Oct 7, 2011 at 1:16 PM, John Huss wrote: >

Re: Question about events in a clustered environment

2011-07-13 Thread Dave Lamy
s no sense. Lifecycle *listeners* > (that are not persistent objects) are only notified of events on local VM > objects. But the listeners can generate their own clustered events of course > (CacheInvalidationFilter mentioned above is one example of this). > > Andrus > > > On

Question about events in a clustered environment

2011-05-17 Thread Dave Lamy
Hey guys-- In a clustered cayenne environment (I'm using the JMS event bridge), do all nodes receive all cayenne events (talking preInsert, postUpdate, etc etc). Only some of them? None of them? I just realized I may be making some massive assumptions here. Thanks, Dave

Exception/rollback behavior question

2011-04-27 Thread Dave Lamy
that threw the deadlock. Question is, if I catch the deadlock exception and then recommit, are all of the modification states still intact? Or is there an intrinsic rollback that occurs before I have a chance to retry the commit? Thanks in advance for your help-- Dave Lamy

Re: Bug with EJBQL query referencing two subclasses?

2010-09-21 Thread Dave Lamy
OK thanks Aristedes.. I've created the JIRA and attached the patch file. https://issues.apache.org/jira/browse/CAY-1483 Dave On Mon, Sep 20, 2010 at 7:38 PM, Aristedes Maniatis wrote: > On 21/09/10 6:56 AM, Dave Lamy wrote: > >> Patch attached. >> > > Hi Dave >

Re: Bug with EJBQL query referencing two subclasses?

2010-09-20 Thread Dave Lamy
buffer and appends an AND in if length > 0. Works like a charm. Patch attached. Dave On Wed, Sep 15, 2010 at 10:28 AM, Dave Lamy wrote: > Thanks Andrus, I'll let you know what I find. > > Dave > > > On Tue, Sep 14, 2010 at 4:41 PM, Andrus Adamchik > wrote: > >>

Re: Bug with EJBQL query referencing two subclasses?

2010-09-15 Thread Dave Lamy
he > places where a placeholder for entity qualifier is created, and a qualifier > is later inserted. > > Cheers, > Andrus > > On Sep 14, 2010, at 10:54 AM, Dave Lamy wrote: > > > Hello Cayenne gurus-- > > > > I hit a SQL syntax problem yesterday while trying to

Bug with EJBQL query referencing two subclasses?

2010-09-14 Thread Dave Lamy
Hello Cayenne gurus-- I hit a SQL syntax problem yesterday while trying to issue a EJBQL query to determine value uniqueness within a given parent "context". The EJBQL query is: SELECT COUNT(distinct a.id) FROM Clip AS a JOIN a.timeline b WHERE a.name = ?1 AND b = ?2[{foo,200}] The interest

Re: ParseException with EJBQL expression

2009-12-21 Thread Dave Lamy
alid in EJBQL. Although the error message refers > >> to something else... strange... > >> > >> > >> > >> On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote: > >> > >> Hey guys-- > >>> > >>> I'm really ju

Re: ParseException with EJBQL expression

2009-12-04 Thread Dave Lamy
close.. Thanks again for the help-- Dave On Fri, Dec 4, 2009 at 10:09 AM, Dave Lamy wrote: > 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 t

Re: ParseException with EJBQL expression

2009-12-04 Thread Dave Lamy
ccording 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

Re: ParseException with EJBQL expression

2009-12-04 Thread Dave Lamy
> to something else... strange... > > > > On Dec 4, 2009, at 4:12 AM, Dave Lamy wrote: > > 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 fund

Re: Referencing ID fields in EJBQL

2009-12-04 Thread Dave Lamy
s. Auto > generation will still work, etc. > > Andrus > > > On Dec 4, 2009, at 12:05 AM, Dave Lamy wrote: > > Hello all-- >> >> I am curious to know how (if possible) to reference a PK field using >> EJBQL. >>

ParseException with EJBQL expression

2009-12-03 Thread Dave Lamy
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 fo

Referencing ID fields in EJBQL

2009-12-03 Thread Dave Lamy
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 eith

Re: First time inheritance attempt

2009-09-24 Thread Dave Lamy
> don't think vertical has been implemented yet. There is still an open > ticket for vertical inheritance: > > https://issues.apache.org/jira/browse/CAY-1090 > > > On Thu, Sep 24, 2009 at 1:59 PM, Dave Lamy wrote: > > Yes, I'm attempting vertical multiple-table i

Re: First time inheritance attempt

2009-09-24 Thread Dave Lamy
ed yet. > Cayenne can do in-table inheritance using a discriminator column. > > > On Thu, Sep 24, 2009 at 1:10 PM, Dave Lamy wrote: > > Hey guys-- > > > > I'm attempting to model some inheritance for the first time and it's not > > working yet. Here&#

First time inheritance attempt

2009-09-24 Thread Dave Lamy
Hey guys-- I'm attempting to model some inheritance for the first time and it's not working yet. Here's my situation: My model is to have a non-abstract parent class->table and then subclass->tables like so: First I should doublecheck to make sure my mapping XML looks OK: ...

Re: Determining modified attribute values

2009-09-24 Thread Dave Lamy
t; > oversee changes during preUpdate(), try to get old values from cached > > snapshot: > > DataRow snapshot = > > context.getObjectStore().getCachedSnapshot(cdo.getObjectId()); > > String oldValue = (String) snapshot.get("FILENAME"); > > > > 2009

Determining modified attribute values

2009-09-17 Thread Dave Lamy
Forgive me if this has already been hashed out, but my google-foo isn't working well today. I have a case where, upon saving a persistent object with a modified attribute value, I need to perform a file migration. The trick is that I need to know both the previous and new values of the attribute

Shared cache troubles

2009-08-13 Thread Dave Lamy
Hey guys-- I'm seeing a problem with inconsistent object data across contexts using a shared cache and am hoping someone can shed some light for me. I've got a situation where 2 threads (each with its own context) winds up interacting with the same persistent object. The first thread updates the

Simple callback question

2009-07-23 Thread Dave Lamy
Should the preUpdate callback event get fired for both new and existing objects? The behavior I'm seeing (3.0M5) is that preUpdate is not getting called when saving my new object, but does get called when saving an existing object. prePersist is not the correct time for my event code to run.. I ne

Re: Transient objects question

2009-06-22 Thread Dave Lamy
> Hi Dave, > > Are you getting the NPE immediately after calling: > > codeVersion.setMajorNumber(1); > > or is it further along? > > > On Sun, Jun 21, 2009 at 10:07 PM, Dave Lamy wrote: > > Quick question/problem on transient objects: > > > > I'v

Transient objects question

2009-06-21 Thread Dave Lamy
Quick question/problem on transient objects: I've got a persistent class AppVersion, which simply tracks a version of the code/database values for migration purposes. I want to have a persistent AppVersion in the database, but then create a transient AppVersion representing the code version for c

Re: Group function support

2009-06-10 Thread Dave Lamy
name. > > Andrus > > > > On Jun 10, 2009, at 5:52 PM, Dave Lamy wrote: > >> Thanks for the FYI Andrus. >> >> I'll just punt to a named query for the time being. Thanks for logging in >> the JIRA. My concern would be that it would probably be a lo

Re: Group function support

2009-06-10 Thread Dave Lamy
> to investigate the issue. Sorry, this also means you'll have to use > SQLTemplate. > > Andrus > > > > On Jun 10, 2009, at 12:14 AM, Dave Lamy wrote: > > Hey guys-- I'm trying to get group functions operational in my >> Cayenne-backed system. As f

Group function support

2009-06-09 Thread Dave Lamy
pl doesn't support the generic base class concept. Am I right on this? I don't care about EJBQL, just want to get group functions working without having to resort to rolling a bunch of dynamic SQL :-). Perhaps an upgrade to M6 is in order? Thanks in advance for any help you can provide! --Dave Lamy

Determining objects affected by a delete

2009-05-20 Thread Dave Lamy
When an object is deleted via the UI, I would like to be able to report back all objects that were affected by the delete, especially objects that were deleted by cascade rules. What is the best way to determine this affected set? Thanks in advance for any insight on this. Dave

Starting up with different cayenne.xml filename

2009-05-13 Thread Dave Lamy
This is probably immensely easy but the coffee isn't working this morning: I was hoping to spring-inject a cayenne configuration filename (cayenne.xml by default). I've looked at the Configuration class but any opportunity to use something other than DEFAULT_DOMAIN_FILE seems to only be scoped at

Re: Quick query question

2009-04-07 Thread Dave Lamy
Actually I totally lied just then. Didn't like the "db:".. had to remove. My initial test case turned out to be faulty. Guess I need a test case for my test case :-). Anyway thanks again. On Tue, Apr 7, 2009 at 11:37 AM, Dave Lamy wrote: > That did it Mike-- great cal

Re: Quick query question

2009-04-07 Thread Dave Lamy
That did it Mike-- great call! Thanks for the assist. Didn't have to remove the db: .. not sure if it would work without it or not. Dave On Mon, Apr 6, 2009 at 8:10 AM, Michael Gentry wrote: > Maybe instead of: > > Expression expr = ExpressionFactory.inExp("db:" + pkName, idValues); > > Use: >

Re: Quick query question

2009-04-03 Thread Dave Lamy
h me using a db: prefixed path in a normal SelectQuery? Can anyone point me at the code that attempts to do this db: parse so I can try and step through? I'm rather stumped on this one. Thanks! Dave On Thu, Apr 2, 2009 at 1:36 PM, Dave Lamy wrote: > Thanks guys. > > I'm act

Re: Quick query question

2009-04-02 Thread Dave Lamy
ting > primary key attrs at reverse-engineering > > 2009/4/2 Dave Lamy > > > No, I didn't.. just did the standard Cayenne mapping with a database ID > > column (auto-generated) which of course is not exposed in the Java class. > > What makes this even more fun is

Re: Quick query question

2009-04-02 Thread Dave Lamy
Thu, Apr 2, 2009 at 12:01 PM, Michael Gentry wrote: > Did you map your primary key as a Java attribute? If so, just include it. > > > On Thu, Apr 2, 2009 at 12:53 PM, Dave Lamy wrote: > > I am composing a SelectQuery and want to include an expression to narrow > my > &

Quick query question

2009-04-02 Thread Dave Lamy
I am composing a SelectQuery and want to include an expression to narrow my results based upon the primary key (just an int ID) as well as other criteria. I am using the ExpressionFactory to generate the Expressions.. specifically I have Expression expr = ExpressionFactory.inExp(, idCollection);

Importing DataMaps

2009-03-30 Thread Dave Lamy
Hey guys-- We have a number of different clients, each of which make use of a common foundation of code. I want each client's codebase to have its own cayenne.xml, but import a common DataMap that would provide tables/classes for global concepts (security role/user classes being a good example).

Import DataMap?

2009-03-27 Thread Dave Lamy
Hey guys-- I noticed a menu item in the Modeller (using 3.0 M5) called Import DataMap. Not sure, but guessing I could use this.. I have a DataMap that has core data classes that I'd like to copy or ideally share across client projects. Thought perhaps I could import that map into the client-based

Re: Qualifier Expression

2009-03-14 Thread Dave Lamy
Here's what I would do: 1) Tables set up as you describe. CUSTOMER would have a BILL_ADDRESS_ID and a SHIP_ADDRESS_ID, both of which are FK references to the ADDRESS table. 2) Set up DB joins from Customer to Address, and vice-versa. 3) Set up ObjEntities for Customer and Address, and create Ob

Re: Factory method subclassing cayenne data objects

2009-03-02 Thread Dave Lamy
Hey Hans-- While I'm certain that the inheritance structure isn't data based to you, I imagine that Cayenne is going to HAVE to have a data value to know which subclass to instantiate. It's effectively going to get back a row from the Artist table and be asked to transform that row into an Artist

Re: First time writer/Design ideas

2009-03-02 Thread Dave Lamy
nd our internal DB for query purposes.. On Mon, Mar 2, 2009 at 10:44 AM, Andrus Adamchik wrote: > Hi Dave, > > Good to see that you liked Cayenne. Some comments in addition to what Ari > said... > > > On Mar 1, 2009, at 1:38 PM, Dave Lamy wrote: > >> So Question #1:

First time writer/Design ideas

2009-03-01 Thread Dave Lamy
Hello Cayenne luminaries-- I've recently started getting deep in Cayenne (running 3.0 M5) and I must say that it's been a pleasure thus far. Not only does the API fit my mode of thinking and design much better than The ORM That Shall Not Be Named, but the mailing lists have actually been full of