Re: where to put Cayenne.xml

From: Mike Kienenberger (mkienen..mail.com)
Date: Fri Mar 31 2006 - 16:00:40 EST


On 4/1/06, WONDER <mmmmmmmmm5..eb.de> wrote:
> Adding the xml files to Class directory worked. Unfortunateley They must be
> directly in the src directery, I cant put them in thier own directery like
> "Model.Cayenne". Similer to EOF.

Actually, you can. You just need to specify your own Configuration options:

For instance, I use a ServletContextListener that sets this up. For
WO, you could probably call this from the Application constructor.

    public void contextInitialized(ServletContextEvent event)
    {
        DefaultConfiguration conf = new DefaultConfiguration();
        conf.addClassPath("com/xyz/cayenne/model");
        Configuration.initializeSharedConfiguration(conf);
    }

============================================================================
> 1: WO need NSArray for repetion something like customer.projects
> Solutions: use custom subclass.vm

Yep.

============================================================================
> 2: WO uses the NSMutableDictionary, and its very handy to use it as
> lookup.name, lookup.password, etc..
> Cayenne needs Map.
> Solution: Convert the lookup into Map:

Yep.

============================================================================
> 3: I had an existing Application and then decided to switch, I think you
> want to do the same.
> i.e. You have to change all xxx.saveChange() into xxx.commitChanges. No
> need. here is the solution :)

Yep.

> BTW: i still dont understand why and when should i say removeToManyTarget(
> relName, value, FALSE ); !!!

Generally, you wouldn't. But the possibility is there if you need it.

============================================================================
> 4: Session has the DefaultEditingContext, I think everybody who uses WO, can
> not develop without using the defaultEditiongContext from the Session. so
> here is it for Cayenne :).

Actually, you should return the default cayenne session data context instead:

        return ServletUtil.getSessionContext(session);

But I can't remember how accessible the HttpSession is under 5.2.

============================================================================
> Till now I am very happy using Cayenne. I think I will never go back to EOF.
> Cayenne is really good and has very great level comparing to Tapestry which
> still has not the parellel
> "WebObjects Builder" tool . And the PlugIn Spindle still uses Tapestry 3.
> Cayenne has great GUI and its alomost even better than EOF GUI tool. For
> example Cayenne uses the last JDBC drivers. EOF still needs the old once.
>
> You will face minor problems, and as a WO developer you will learn Cayenne
> in about 2 or 3 days. depends of course on you WO experiences.
>
> HTH.
>
> Maybe Its good idea to have a WebSite on Cayenne WebSite for WO developers
> who want to switch. Should ask Andrus :)

See http://www.objectstyle.org/cayenne/userguide/misc.html

This page hasn't been ported over to the Cayenne wiki yet. It'd be
great if you'd do so and also add in the helpful tips you provided
above!

Actually, most of it has been ported, so you'd just need to add more
to this page:

http://www.objectstyle.org/confluence/display/CAY/From+WebObject+to+Cayenne

Thanks.



This archive was generated by hypermail 2.0.0 : Fri Mar 31 2006 - 16:01:04 EST