Grails and legacy Struts + Hibernate App

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails and legacy Struts + Hibernate App

felipenasc
Hi all,

I have an app implemented with Struts + Hibernate. So all hibernate
mapping files already exist. And they are deployed to an existing
webapp in tomcat.

What is tghe best approach to create a new module of this application
using rails? I think this modulo will not really be a module, but a
new Grails app, right? But how to tell grails where to find the hbm
mapping files? Do I have to copy the files to the grails app? Can I
generate a JAR file with them?

Tks
Felipe

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Grails and legacy Struts + Hibernate App

graemer
Hi Felipe,

There is an excellent article just posted showing how to do some of
what you want here:
http://jasonrudolph.com/blog/2006/06/20/hoisting-grails-to-your-legacy-db/

Essentially you need to drop the mapping files into the 'hibernate'
directory and add the classes either to the lib directory in a jar or
if you have the sources you can add them to your grails project.

I assume you meant 'war' when referring to creating a jar, to create a
war just type the following from the root of your grails app:

grails war

Cheers
Graeme

On 6/21/06, Felipe Nascimento <[hidden email]> wrote:

> Hi all,
>
> I have an app implemented with Struts + Hibernate. So all hibernate
> mapping files already exist. And they are deployed to an existing
> webapp in tomcat.
>
> What is tghe best approach to create a new module of this application
> using rails? I think this modulo will not really be a module, but a
> new Grails app, right? But how to tell grails where to find the hbm
> mapping files? Do I have to copy the files to the grails app? Can I
> generate a JAR file with them?
>
> Tks
> Felipe
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Grails and legacy Struts + Hibernate App

felipenasc
tks Graeme ,

actually I thought on creating a JAR file with the hbm files in it, so
I could put this jar in the lib directory of grails app. And somehow
tell grails that the hbm file were in this jar. But copying them into
the hibernate folder is ok I guess.

I read the article. That's why I thought about my problem that is a
bit different from the article. I want not only to use legacy
database, but also hbm files and Model java objects.

Tks again
Felipe

PS. I will try before I continue asking questions...  :-)

2006/6/21, Graeme Rocher <[hidden email]>:

> Hi Felipe,
>
> There is an excellent article just posted showing how to do some of
> what you want here:
> http://jasonrudolph.com/blog/2006/06/20/hoisting-grails-to-your-legacy-db/
>
> Essentially you need to drop the mapping files into the 'hibernate'
> directory and add the classes either to the lib directory in a jar or
> if you have the sources you can add them to your grails project.
>
> I assume you meant 'war' when referring to creating a jar, to create a
> war just type the following from the root of your grails app:
>
> grails war
>
> Cheers
> Graeme
>
> On 6/21/06, Felipe Nascimento <[hidden email]> wrote:
> > Hi all,
> >
> > I have an app implemented with Struts + Hibernate. So all hibernate
> > mapping files already exist. And they are deployed to an existing
> > webapp in tomcat.
> >
> > What is tghe best approach to create a new module of this application
> > using rails? I think this modulo will not really be a module, but a
> > new Grails app, right? But how to tell grails where to find the hbm
> > mapping files? Do I have to copy the files to the grails app? Can I
> > generate a JAR file with them?
> >
> > Tks
> > Felipe
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

RE: Grails and legacy Struts + Hibernate App

Dierk König
In reply to this post by graemer
> http://jasonrudolph.com/blog/2006/06/20/hoisting-grails-to-your-legacy-db/

That'd be excellent to add to an "Articles" page.

I couldn't find a place to add it since we want to keep the
navigation short and crisp...

cheers
Mittie

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Grails and legacy Struts + Hibernate App

graemer
I've added it to the tutorials page

Graeme

On 6/21/06, Dierk Koenig <[hidden email]> wrote:

> > http://jasonrudolph.com/blog/2006/06/20/hoisting-grails-to-your-legacy-db/
>
> That'd be excellent to add to an "Articles" page.
>
> I couldn't find a place to add it since we want to keep the
> navigation short and crisp...
>
> cheers
> Mittie
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Grails and legacy Struts + Hibernate App

graemer
In reply to this post by felipenasc
I imagine having the hbm files in a jar would work to as all Grails
does is attempt to load hibernate.cfg.xml from the classpath and if
this file plus the other hbm files are in the lib directory it will
work too

Graeme

On 6/21/06, Felipe Nascimento <[hidden email]> wrote:

> tks Graeme ,
>
> actually I thought on creating a JAR file with the hbm files in it, so
> I could put this jar in the lib directory of grails app. And somehow
> tell grails that the hbm file were in this jar. But copying them into
> the hibernate folder is ok I guess.
>
> I read the article. That's why I thought about my problem that is a
> bit different from the article. I want not only to use legacy
> database, but also hbm files and Model java objects.
>
> Tks again
> Felipe
>
> PS. I will try before I continue asking questions...  :-)
>
> 2006/6/21, Graeme Rocher <[hidden email]>:
> > Hi Felipe,
> >
> > There is an excellent article just posted showing how to do some of
> > what you want here:
> > http://jasonrudolph.com/blog/2006/06/20/hoisting-grails-to-your-legacy-db/
> >
> > Essentially you need to drop the mapping files into the 'hibernate'
> > directory and add the classes either to the lib directory in a jar or
> > if you have the sources you can add them to your grails project.
> >
> > I assume you meant 'war' when referring to creating a jar, to create a
> > war just type the following from the root of your grails app:
> >
> > grails war
> >
> > Cheers
> > Graeme
> >
> > On 6/21/06, Felipe Nascimento <[hidden email]> wrote:
> > > Hi all,
> > >
> > > I have an app implemented with Struts + Hibernate. So all hibernate
> > > mapping files already exist. And they are deployed to an existing
> > > webapp in tomcat.
> > >
> > > What is tghe best approach to create a new module of this application
> > > using rails? I think this modulo will not really be a module, but a
> > > new Grails app, right? But how to tell grails where to find the hbm
> > > mapping files? Do I have to copy the files to the grails app? Can I
> > > generate a JAR file with them?
> > >
> > > Tks
> > > Felipe
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe from this list please visit:
> > >
> > >     http://xircles.codehaus.org/manage_email
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Grails and legacy Struts + Hibernate App

felipenasc
thats great

Tks

2006/6/21, Graeme Rocher <[hidden email]>:

> I imagine having the hbm files in a jar would work to as all Grails
> does is attempt to load hibernate.cfg.xml from the classpath and if
> this file plus the other hbm files are in the lib directory it will
> work too
>
> Graeme
>
> On 6/21/06, Felipe Nascimento <[hidden email]> wrote:
> > tks Graeme ,
> >
> > actually I thought on creating a JAR file with the hbm files in it, so
> > I could put this jar in the lib directory of grails app. And somehow
> > tell grails that the hbm file were in this jar. But copying them into
> > the hibernate folder is ok I guess.
> >
> > I read the article. That's why I thought about my problem that is a
> > bit different from the article. I want not only to use legacy
> > database, but also hbm files and Model java objects.
> >
> > Tks again
> > Felipe
> >
> > PS. I will try before I continue asking questions...  :-)
> >
> > 2006/6/21, Graeme Rocher <[hidden email]>:
> > > Hi Felipe,
> > >
> > > There is an excellent article just posted showing how to do some of
> > > what you want here:
> > > http://jasonrudolph.com/blog/2006/06/20/hoisting-grails-to-your-legacy-db/
> > >
> > > Essentially you need to drop the mapping files into the 'hibernate'
> > > directory and add the classes either to the lib directory in a jar or
> > > if you have the sources you can add them to your grails project.
> > >
> > > I assume you meant 'war' when referring to creating a jar, to create a
> > > war just type the following from the root of your grails app:
> > >
> > > grails war
> > >
> > > Cheers
> > > Graeme
> > >
> > > On 6/21/06, Felipe Nascimento <[hidden email]> wrote:
> > > > Hi all,
> > > >
> > > > I have an app implemented with Struts + Hibernate. So all hibernate
> > > > mapping files already exist. And they are deployed to an existing
> > > > webapp in tomcat.
> > > >
> > > > What is tghe best approach to create a new module of this application
> > > > using rails? I think this modulo will not really be a module, but a
> > > > new Grails app, right? But how to tell grails where to find the hbm
> > > > mapping files? Do I have to copy the files to the grails app? Can I
> > > > generate a JAR file with them?
> > > >
> > > > Tks
> > > > Felipe
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe from this list please visit:
> > > >
> > > >     http://xircles.codehaus.org/manage_email
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe from this list please visit:
> > >
> > >     http://xircles.codehaus.org/manage_email
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

RE: Grails and legacy Struts + Hibernate App

Dierk König
In reply to this post by graemer
cool.

Mittie

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]On Behalf
> Of Graeme Rocher
> Sent: Mittwoch, 21. Juni 2006 15:59
> To: [hidden email]
> Subject: Re: [grails-user] Grails and legacy Struts + Hibernate App
>
>
> I've added it to the tutorials page
>
> Graeme
>
> On 6/21/06, Dierk Koenig <[hidden email]> wrote:
> > >
> http://jasonrudolph.com/blog/2006/06/20/hoisting-grails-to-your-legacy-db/
> >
> > That'd be excellent to add to an "Articles" page.
> >
> > I couldn't find a place to add it since we want to keep the
> > navigation short and crisp...
> >
> > cheers
> > Mittie
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email