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 7178793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:59:30+00:00 2026-05-28T16:59:30+00:00

In a Grails project, if I place my entity classes in the /domain folder,

  • 0

In a Grails project, if I place my entity classes in the /domain folder, Grails automatically attempts to use GORM/Hibernate for persistence. If I’m peristing to a different type of store, say Mongo, Reddis, etc, can I still place my classes in the domain folder and implement my own persistence logic?

I’ve disabled hibernate and domain in BuildConfig.groovy using excludes 'hibernate,domain', but Grails still complains..perhaps I should just place my domain classes in src/groovy/mypackage…

  • 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-28T16:59:32+00:00Added an answer on May 28, 2026 at 4:59 pm

    Grails slightly misuses the term domain. Domain classes in Grails are persistent classes, whether they’re persistent with Hibernate or NoSQL or both. If you want to manage things yourself put them in src/groovy.

    If you want to use NoSQL consider using one of the plugins, e.g. mongodb or redis-gorm. If the NoSQL plugin is the only persistence plugin installed (i.e. you’ve removed the Hibernate plugin) then a domain class in grails-app/domain will use that plugin. If you still have the Hibernate plugin installed, the domain class will default to being a Hibernate domain class but you can specify that it’s a NoSQL domain class with the mapWith property, e.g. static mapWith = "mongo". This is described in the docs for the plugins.

    You probably don’t want to remove the domain plugin though – I don’t think there’s any benefit and it’ll most likely break important features.

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

Sidebar

Related Questions

In a grails project, some of the domain classes have a region field (not
I am migrating my grails project from using Hibernate XML to just GORM defined
i have a grails project Customer customer = Customer.get(params.id) where customer is a domain
I have a grails project with some additional java source files under src/java folder.
In my grails project I'm moving all calculations to java classes. Here is the
I have a grails project and I use the gwt plugin 0.6.1. GWT version
I have a Grails project that is using Hibernate XML. The Hibernate file are
I have the following domain class in my grails project: class Vacation { Date
How to setup Grails project to use Amazon SimpleDB? One possibility is to install
I'm investigating a personal Grails project and want to put together a domain model

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.