Re: Tracking down a Runtime Relationship - Cayenne 3.1

2016-03-19 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 adding/calling this to p

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 me? When I have loggin

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 referenc

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 H

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 model's > source/destinati

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 clu

Re: Populating a test DB for use with Cayenne

2016-03-19 Thread Aristedes Maniatis
On 16/03/2016 9:31pm, Hugi Thordarson wrote: > Hi all. > > Just out of curiosity; how are you guys populating your test DBs before > running tests? Has anyone written something brilliant to do it with e.g. > .yml-files (via Cayenne)? Are you doing it via SQL-scripts? In code perhaps? > > I’m cu

Re: Populating a test DB for use with Cayenne

2016-03-19 Thread Michael Gentry
For H2, I've used: http://www.h2database.com/javadoc/org/h2/tools/RunScript.html Then create some SQL scripts with bulk inserts of test data. mrg On Wed, Mar 16, 2016 at 6:31 AM, Hugi Thordarson wrote: > Hi all. > > Just out of curiosity; how are you guys populating your test DBs before > ru

Re: Populating a test DB for use with Cayenne

2016-03-19 Thread Hugi Thordarson
Thanks, Michael and Ari! I’m going to look at both this and DBUnit (I’m currently using H2 so RunScript looks like it might fit the bill). Cheers, - hugi > On 16. mar. 2016, at 22:22, Michael Gentry wrote: > > For H2, I've used: > > http://www.h2database.com/javadoc/org/h2/tools/RunScript.

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 wrote: > BTW, t

Re: Populating a test DB for use with Cayenne

2016-03-19 Thread Michael Gentry
If it helps, here is one of my test classes that used RunScript to load data: public abstract class TestDatabaseBase extends TestBase { private static final Log log = LogFactory.getLog(TestDatabaseBase.class); @BeforeClass public static void loadSQL() throws SQLException {