Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 194075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:33:51+00:00 2026-05-11T16:33:51+00:00

I have a Java\Spring\Hibernate application – complete with domain classes which are basically Hibernate

  • 0

I have a Java\Spring\Hibernate application – complete with domain classes which are basically Hibernate POJOs

There is a piece of functionality that I think can be written well in Grails.

I wish to reuse the domain classes that I have created in the main Java app

What is the best way to do so ?

Should I write new domain classes extending the Java classes ? this sounds tacky
Or Can I ‘generate’ controllers off the Java domain classes ?

What are the best practices around reusing Java domain objects in Grails\Groovy
I am sure there must be others writing some pieces in grails\groovy

If you know about a tutorial which talks about such an integration- that would be awesome !!!

PS: I am quite a newbie in grails-groovy so may be missing the obvious. Thanks !!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:33:51+00:00Added an answer on May 11, 2026 at 4:33 pm

    Do you really want/need to use Grails rather than just Groovy?

    Grails really isn’t something you can use to add a part to an existing web app. The whole “convention over configuration” approach means that you pretty much have to play by Grails’ rules, otherwise there is no point in using it. And one of those rules is that domain objects are Groovy classes that are heavily “enhanced” by the Grails runtime.

    It might be possible to have them extend existing Java classes, but I wouldn’t bet on it – and all the Spring and Hibernate parts of your existing app would have to be discarded, or at least you’d have to spend a lot of effort to make them work in Grails. You’ll be fighting the framework rather than profiting from it.

    IMO you have two options:

    • Rewrite your app from scratch in Grails while reusing as much of the existing code as possible.
    • Keep your app as it is and add new stuff in Groovy, without using Grails.

    The latter is probably better in your situation. Grails is meant to create new web apps very quickly, that’s where it shines. Adding stuff to an existing app just isn’t what it was made for.

    EDIT:
    Concerning the clarification in the comments: if you’re planning to write basically a data entry/maintenance frontend for data used by another app and have the DB as the only communication channel between them, that might actually work quite well with Grails; it can certainly be configured to use an existing DB schema rather than creating its own from the domain classes (though the latter is less work).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 110k
  • Answers 110k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found the answer that suited me perfectly. A lil… May 11, 2026 at 9:34 pm
  • Editorial Team
    Editorial Team added an answer As always, there is cacls.exe (or xcacls) to change the… May 11, 2026 at 9:34 pm
  • Editorial Team
    Editorial Team added an answer This isn't possible using UIKit. I would recommend creating a… May 11, 2026 at 9:34 pm

Related Questions

I have create a getDBConnection method in my Java application. This returns a connection
We have a Hibernate/Spring application that have the following Spring beans: <bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager
I'm using Hibernate with Spring in my application. I have been consistently using detached
We're using Spring/Hibernate on a Websphere Application Server for AIX. On my Windows machine,
I'm using Grails 1.1 beta2. I need to import a large amount of data

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.