Spring Roo
  1. Spring Roo
  2. ROO-589

Setting method names to blank on @RooEntity does not prevent those methods from being generated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1.RELEASE
    • Fix Version/s: 1.0.2.RELEASE
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      Setting methods names to blank on @RooEntity does not prevent those methods from being generated the same way versionField="" does, the settings appear to be ignored.

      My specific requirement is to make an Entity read only (persistMethod="", removeMethod="", mergeMethod="") but all of the method name attributes should probably work the same way.

        Activity

        Hide
        Stefan Schmidt added a comment -

        Just as a side comment, this also applies to the countMethod as discussed here http://forum.springsource.org/showthread.php?p=283593#post283593

        Show
        Stefan Schmidt added a comment - Just as a side comment, this also applies to the countMethod as discussed here http://forum.springsource.org/showthread.php?p=283593#post283593
        Hide
        Ben Alex added a comment -

        Adjustments to EntityMetadata and WebScaffoldMetadata checked into SVN revision 621.

        The test annotation was:

        @RooEntity(persistMethod="", removeMethod="", mergeMethod="", finders =

        { "findVisitsByDescriptionAndVisitDate", "findVisitsByVisitDateBetween", "findVisitsByDescriptionLike" }

        )

        Please be aware data on demand and integration testing will of course not work if you disable the creation of these methods. But it now works fine if you just wanted to switch the methods off.

        Note if you have an inheritance hierarchy you will need to switch off the methods for each type in the hierarchy. So if your have say Vet extends AbstractPerson and you put @RooEntity(persistMethod="") on AbstractPerson, the AbstractPerson will NOT have a persist method but the Vet will have a persist method. To remove the persist method from Vet, you will need to similarly annotate Vet with @RooEntity(persistMethod="").

        I've asked Stefan to take a look over the implications of this change from a web scaffolding perspective. I just made the minimal changes necessary avoid NPEs.

        Show
        Ben Alex added a comment - Adjustments to EntityMetadata and WebScaffoldMetadata checked into SVN revision 621. The test annotation was: @RooEntity(persistMethod="", removeMethod="", mergeMethod="", finders = { "findVisitsByDescriptionAndVisitDate", "findVisitsByVisitDateBetween", "findVisitsByDescriptionLike" } ) Please be aware data on demand and integration testing will of course not work if you disable the creation of these methods. But it now works fine if you just wanted to switch the methods off. Note if you have an inheritance hierarchy you will need to switch off the methods for each type in the hierarchy. So if your have say Vet extends AbstractPerson and you put @RooEntity(persistMethod="") on AbstractPerson, the AbstractPerson will NOT have a persist method but the Vet will have a persist method. To remove the persist method from Vet, you will need to similarly annotate Vet with @RooEntity(persistMethod=""). I've asked Stefan to take a look over the implications of this change from a web scaffolding perspective. I just made the minimal changes necessary avoid NPEs.

          People

          • Assignee:
            Ben Alex
            Reporter:
            Peter C Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: