Grails
  1. Grails
  2. GRAILS-2515

ability to disable persistence on domain classes

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.3.5
    • Component/s: None
    • Labels:
      None

      Description

      It would be nice to be able to keep non-persistent domain entities together with persistent domain entities under grails-app/domain/ , rather than it being necessary to continue splitting non-persistant domain entities into src/*

      For example, something along the lines of :

      static persistent = false
      
      or maybe
      
      static mappings = { table false }
      

      ... which would ensure that the class does not get mapped into a table and is not injected with any gorm methods.

      For reference, a rather lengthy thread on the matter:

      http://grails.1312388.n4.nabble.com/RE-Where-do-we-put-our-business-logic-td1338547.html

        Activity

        Hide
        marko.m added a comment -

        This is a critical issue for me, particularly in an enterprise ERP environment where i do not have control of the schema, and where all queries are necessarily large, complicated, and hand tuned. In this scenario (which is not uncommon), Hibernate is not practical.

        It would also be very helpful where manual fine-grained control is needed for persistence, or for transient Domain objects.

        It seems that upcoming work the JPA plugin, JCR plugin, and 1.1 plugin refactoring, will lead to decoupling of the Hibernate Domain implementation from Grails. Thank you, this is a VERY good thing.

        Hibernate is great, but there are many persistence scenarios where it is not appropriate. Or an app may have domain objects that are persisted in several ways (eg. Hibernate, JCR, and non-persisted) in a single overall domain model. So allowing many persistence plugins to co-exist in a single runtime would also be very good.

        Also having standard, documented interfaces/framework to create new persistence plugins would be great.

        Thank you for all the great work!

        Show
        marko.m added a comment - This is a critical issue for me, particularly in an enterprise ERP environment where i do not have control of the schema, and where all queries are necessarily large, complicated, and hand tuned. In this scenario (which is not uncommon), Hibernate is not practical. It would also be very helpful where manual fine-grained control is needed for persistence, or for transient Domain objects. It seems that upcoming work the JPA plugin, JCR plugin, and 1.1 plugin refactoring, will lead to decoupling of the Hibernate Domain implementation from Grails. Thank you, this is a VERY good thing. Hibernate is great, but there are many persistence scenarios where it is not appropriate. Or an app may have domain objects that are persisted in several ways (eg. Hibernate, JCR, and non-persisted) in a single overall domain model. So allowing many persistence plugins to co-exist in a single runtime would also be very good. Also having standard, documented interfaces/framework to create new persistence plugins would be great. Thank you for all the great work!
        Hide
        Graeme Rocher added a comment -

        Moving non-critical issues that aren't going to make it into 1.1 to 1.2

        Show
        Graeme Rocher added a comment - Moving non-critical issues that aren't going to make it into 1.1 to 1.2
        Hide
        Graeme Rocher added a comment -

        There is no scope / time to resolve these remaining lower priority issues for 1.2 so moving to 1.3

        for 1.2 final only issues considered blocking will now be fixed

        Show
        Graeme Rocher added a comment - There is no scope / time to resolve these remaining lower priority issues for 1.2 so moving to 1.3 for 1.2 final only issues considered blocking will now be fixed
        Hide
        numan salati added a comment - - edited

        What is the update on this feature? Is it planned for any of the upcoming releases (1.3.5 or 1.3.6)?

        Show
        numan salati added a comment - - edited What is the update on this feature? Is it planned for any of the upcoming releases (1.3.5 or 1.3.6)?
        Hide
        Graeme Rocher added a comment -

        This feature has worked for a while with 1.1 and 1.2 by specifying:

        static mapWith = "none"
        

        It wasn't working with 1.3 due to the switch to support annotated hibernate entities by default. I have fixed that for 1.3.5:

        http://github.com/grails/grails-core/commit/767696f74079f29da06c535b40c6ba4d6ba38802

        Show
        Graeme Rocher added a comment - This feature has worked for a while with 1.1 and 1.2 by specifying: static mapWith = "none" It wasn't working with 1.3 due to the switch to support annotated hibernate entities by default. I have fixed that for 1.3.5: http://github.com/grails/grails-core/commit/767696f74079f29da06c535b40c6ba4d6ba38802

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Corey
          • Votes:
            22 Vote for this issue
            Watchers:
            23 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development