Re: ClassLoader vs GroovyClassLoader

2010-11-04 Thread caden whitaker
YOU ROCK! That was all I needed to do, here is the full dynamic and groovified code, I'll eventually put this in a blog or something, but at least for not it'll be part of the internet. This is going to look like a lot of code, but most of it is auto-generated from Cayenne Modeler. CayenneUnitTe

Re: ClassLoader vs GroovyClassLoader

2010-11-03 Thread caden whitaker
c.addDomain(new DataDomain("default")); On Wed, Nov 3, 2010 at 2:29 PM, caden whitaker wrote: > Hey all, hope you aren't tired of me yet > > This in a nutshell is the problem: > ClassLoader parent = getClass().getClassLoader(); >

ClassLoader vs GroovyClassLoader

2010-11-03 Thread caden whitaker
Hey all, hope you aren't tired of me yet This in a nutshell is the problem: ClassLoader parent = getClass().getClassLoader(); GroovyClassLoader loader = new GroovyClassLoader(parent); loader.parseClass(new File("C:\\tutorial\\src\\main\\java\\org\\example\\cayen

Re: DataMap.loadDataMap existing ObjectContext?

2010-11-02 Thread caden whitaker
Got it working, here is the code, note this code can probably be reduced, but it at least did the job DataDomain dd = Configuration.getSharedConfiguration().getDomain(); MapLoader ml = new MapLoader(); DataMap dataMap = ml.loadDataMap(new InputSource(new Fil

Re: DataMap.loadDataMap existing ObjectContext?

2010-11-02 Thread caden whitaker
Hrm.. here's the full stacktrace - if I take the XML and load it through normal cayenne processes the unit test passes, so the xml is valid, it must not be fully qualifying the DataMap for some reason. org.apache.cayenne.CayenneRuntimeException: [v.3.0RC2 Feb 03 2010 13:38:54] Commit Exception

Re: DataMap.loadDataMap existing ObjectContext?

2010-11-02 Thread caden whitaker
the data domain. > > DataDomain yourDataDomain = > Configuration.getSharedConfiguration().getDomain(); > > > > On Tue, Nov 2, 2010 at 9:59 AM, caden whitaker > wrote: > > Hey all, > > > > I'm still on my quest to get this stuff loaded dynamic

DataMap.loadDataMap existing ObjectContext?

2010-11-02 Thread caden whitaker
Hey all, I'm still on my quest to get this stuff loaded dynamically. Here's what I'm doing now, first I gutted the map xml file so that it looks like this: TestProjectSourceMap.map.xml http://cayenne.apache.org/schema/3.0/modelMap"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:

Dynamic loading of configuration mapping

2010-10-27 Thread caden whitaker
Hey all, thank you for your help so far! The latest thing I have been looking at is how to dynamically update the mapping files in cayenne. I see some methods available but I wanted to know what best practices were for this situation. For example, I am using the tutorial so I have an ARTIST, GALLE

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
RENCES ARTIST (ID). Do > you have artist_id attribute (column) which is artist FK in PAINTING table? > It seems you have id of PAINTING which is PK also as FK. Please check that. > > Cheers, > Borut > > 2010/10/26 caden whitaker > > > Hey Mike, > > > > I was

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
; > Also, in your unit test, you are setting > > > > picasso.addToPaintings(girl); > > picasso.addToPaintings(stein); > > > > but this is not needed. Cayenne automatically sets the other side of the > > relationship for you, unlike Hibernate. &g

Re: Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
st, you are setting > > picasso.addToPaintings(girl); > picasso.addToPaintings(stein); > > but this is not needed. Cayenne automatically sets the other side of the > relationship for you, unlike Hibernate. > > -Borut > > 2010/10/26 caden whitaker >

Cayenne Tutorial: INSERT on table 'PAINTING' caused a violation of foreign key constraint

2010-10-26 Thread caden whitaker
Hey all, Running through the tutorials, I know what that error means, but I don't think I've done anything wrong. Can someone take a quick look at this xml/object set and tell me what I did wrong? Any help would be greatly appreciated. Mapping.xml http://cayenne.apache.org/schema/3.0/modelMap";

Groovy + Cayenne (Dynamic Loading of Mapping Files)

2010-10-20 Thread caden whitaker
So I've been sending out the same question all over the internets, hopefully those of you that have seen my question are not entirely sick of me by now. Here's my conundrum: I'd like to have my groovy files be compiled on the fly and then sent to the ORM, the ORM would then compile and do all the