Results 1 to 5 of 5

Thread: Read-only Entity(s)?

  1. #1
    Join Date
    Jan 2010
    Posts
    4

    Default 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. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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:

    Code:
    @RooWebScaffold(create=false, update=false, delete=false)
    Cheers,
    Stefan
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3
    Join Date
    Jan 2010
    Posts
    4

    Default

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

    http://jira.springframework.org/browse/ROO-589

    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.

    Thanks

    -Peter M

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    I'll get the @RooEntity problem fixed for 1.0.2.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  5. #5
    Join Date
    Jan 2010
    Posts
    4

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •