Announcement Announcement Module
No announcement yet.
Read-only Entity(s)? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read-only Entity(s)?

    I've looked around a bit but haven't seen anyone else asking about this. If I have read-only access to existing tables (in my case HR data), there doesn't seem to be a way to turn off the persist, merge, remove etc. methods. Version can be disabled by passing an empty string to the versionField on @RooEntity, but persistMethod="" etc. seem to be ignored. A single readOnly flag would be ideal.

  • #2
    The intended way for this to work is indeed persistMethod="". Unfortunately this is currently not working. It would be great if you could raise this as a bug so we can fix it for the next release.

    If you are using the Roo scaffolded Web UI you can tell Roo to not expose the delete, create or update methods in the generated controllers and views by setting the respective flag in @RooWebScaffold:

    @RooWebScaffold(create=false, update=false, delete=false)


    • #3
      Just wanted to make sure I wasn't just doing it wrong before posting a bug.

      I also tried the other methodMethod attributes which I assume are intended to work the same way (eg countMethod="") so the bug is a bit more general than my original question.

      What about the @GeneratedValue annotation on the ID field? Will that go away with the persist method? Or would it just left there because it no longer does anything.


      -Peter M


      • #4
        I'll get the @RooEntity problem fixed for 1.0.2.


        • #5
          Thanks for the update.

          In case anyone ends up here via Google or something I believe the answer to my 2nd question about the @GeneratedValue is to provide the ID field and @Id annotation myself instead of having Roo generate that part.