cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Ratcliffe" <a...@mrigitech.com>
Subject RE: Using business objects instead of XML
Date Mon, 17 Jan 2005 20:32:46 GMT
Hi Brian,

Building on Mark's code snippets, if bizObject was an instance of a
persistable object
you would retrieve it using a Java class that created Hibernate sessions,
this class should
implement the appropriate Avalon lifecycle interfaces so that it can be
managed by the
Cocoon component manager.

The flow interpreter supports the use of Java classes directly in the
flowscript and using
an in-built function associated with the cocoon object you can get an
instance of your
hibernate component like this:

var factory =
cocoon.getComponent(Packages.org.test.PersistenceFactory.ROLE);

You could then get your bizData like this:

var hs = factory.createSession();

var bizData = hs.find("from org.test.Data");

See the wiki document
http://wiki.apache.org/cocoon/CocoonAndHibernateTutorial for a fuller
description of how to do this.

Cheers
Adam

-----Original Message-----
From: Brian Burridge [mailto:maillist@burridge.net]
Sent: Tuesday, 18 January 2005 8:12 a.m.
To: Cocoon Maillist
Subject: Re: Using business objects instead of XML


Using hibernate is what I want to find out about, because where I work
they already use hibernate.

Where do I put the code to get the Hibernate objects? Right now, with
the GUI framework they have, its done in a Struts action, which then
forwards to a JSP page and uses struts tags to display the contents of
the objects.

Brian

On Mon, 2005-01-17 at 13:33, beyaRecords wrote:
> On 17 Jan 2005, at 18:26, Brian Burridge wrote:
>
> > My question is how
> > does cocoon work with Bus
>
> I use cocoon with hibernate via flowscript/jx, but cocoon does have
> it's own persistence layer which you should look ivnto.
>
> regards
>
> Uzo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message