Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-20 Thread Michael Gentry
Hi Frank, You can try adding/calling this to print them: import org.apache.cayenne.map.DbEntity; import org.apache.cayenne.map.DbJoin; import org.apache.cayenne.map.DbRelationship; ... public static void dumpRuntimeRelationships(ObjectContext objectContext) { for (DbEntity

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-20 Thread Michael Gentry
BTW, the code I posted only does database runtime relationships, not Java object relationships, plus it handles compound keys poorly, so there is room for improvement! :-) Thanks, mrg On Thu, Mar 17, 2016 at 10:52 AM, Michael Gentry wrote: > Hi Frank, > > You can try

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-19 Thread Frank Herrmann
Thanks everyone. We were able to pepper some temporary logging in the code and figure out the relationship. I appreciate all the quick responses. -Frank On Thu, Mar 17, 2016 at 10:12 AM, Michael Gentry wrote: > Hi Jurgen, > > Maybe you are seeing something different than

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-19 Thread Michael Gentry
Hi Frank, I don't have any handy code to do this at the moment, but the approach I would take is to write a utility method to dump the model's source/destination relationship information immediately after loading the model into memory. Then, when you get the validation exception, you can

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-19 Thread dollj
Hi yeah, sorry my bad I was out of office and just replied from my faulty memory it seems. Thanks Michael, sorry Frank j -Original Message- From: Michael Gentry Sent: Thursday, March 17, 2016 4:12 PM To: Cayenne Users Subject: Re: Tracking down a Runtime Relationship - Cayenne 3.1

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-19 Thread Frank Herrmann
Thanks. I passed this along to the developer. We are using version 3.1. On Wed, Mar 16, 2016 at 6:29 PM, Michael Gentry wrote: > Hi Frank, > > I don't have any handy code to do this at the moment, but the approach I > would take is to write a utility method to dump the

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-19 Thread dollj
Hi Frank Cayenne logs the runtime relationships it generates when it loads the model into memory. So if you look in the log which it also sends to System.err and search for "runtimeRelationship725" then you will be able to see which entity it's associated with. At least then he'll have a

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-19 Thread Michael Gentry
FWIW, I updated the code to be better at compound keys (I think) and produce slightly better output: https://gist.github.com/mrg/4dce22b67175c27f4047#file-cayenneutils-java-L188 Let me know if there are any issues! Thanks, mrg On Thu, Mar 17, 2016 at 12:03 PM, Michael Gentry

Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-18 Thread Michael Gentry
Hi Jurgen, Maybe you are seeing something different than me? When I have logging turned on, I see things like: org.apache.cayenne.map.EntityResolver added runtime complimentary DbRelationship from s_budget_years to p_line_items ... org.apache.cayenne.map.EntityResolver added runtime

Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-18 Thread Frank Herrmann
Hello all, We have a developer here that recently asked for my help and told him I'd reach out. He is getting a validation failure error on a runtime relationship (specifically runtimeRelationship725). As these are created during runtime, he is setting a break point in the code at the commit to