Results 1 to 7 of 7

Thread: Read-only Entity(s)?

  1. #1
    Join Date
    Nov 2008
    Posts
    27

    Default Read-only Entity(s)?

    Read-only Entity(s)? Was this fixed in 1.0.2?

    There is another thread on this saying it was going to get fixed in 1.0.2, however theres nothing I can see in the documentation about this.

    Interestingly, the reason why its an issue for me is because I want to have particular tables mapped twice onto two different entity classes. I want to do this because I need "light" versions of the entity for presentation reasons. The tests that are generated for these "light" entities have insert tests which fial due to non-null columns that I dont map to.

    The "light" entities need to be read only.

    Can I prevent the insert/update tests from being generated?


    Tim

  2. #2
    Join Date
    Nov 2008
    Posts
    27

    Default

    Quote Originally Posted by tim.taylor View Post
    Read-only Entity(s)? Was this fixed in 1.0.2?

    There is another thread on this saying it was going to get fixed in 1.0.2, however theres nothing I can see in the documentation about this.

    Interestingly, the reason why its an issue for me is because I want to have particular tables mapped twice onto two different entity classes. I want to do this because I need "light" versions of the entity for presentation reasons. The tests that are generated for these "light" entities have insert tests which fial due to non-null columns that I dont map to.

    The "light" entities need to be read only.

    Can I prevent the insert/update tests from being generated?


    Tim
    ok, I found #ROO-589: "Setting method names to blank on @RooEntity does not prevent those methods from being generated"

    How do I get my script to generate the RooEntity annotation such as:

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

    Appologies if this is obvious.

  3. #3
    Join Date
    Nov 2008
    Posts
    27

    Default

    ok, I resigned myself to changing the @RooEntity annotation by hand. There are a lot of entities but I think I can do it with a global find and replace.

    I have a common subclass, but aslong as thats changed to its ok.

    However, is it the case now that I cannot have any integration tests for these entities where I have switched off persist, merge etc?

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

    Default

    Roo will only test methods if their signature matches the signature the integration test infrastructure expects. So if you turn off the methods and don't provide a replacement, there won't be the corresponding test for that method.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  5. #5
    Join Date
    Nov 2008
    Posts
    27

    Default

    Quote Originally Posted by Ben Alex View Post
    Roo will only test methods if their signature matches the signature the integration test infrastructure expects. So if you turn off the methods and don't provide a replacement, there won't be the corresponding test for that method.
    Hi Alex,

    Well, I have turned off the sigs by way of modifying the RooEntity annotation and tried to regenerate the test methods but get the following error. I assumed it was because the integration test generation stuff always expects the same crud operations. I guess not, must be due to something else:

    Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
    roo>
    [timerFactory] Managed SRC_MAIN_JAVA\com\toolkit\entities\BaseFKItem_Roo_ Entity.aj
    roo> test integration --entity ~.entities.cilogs.CiLogTypeFKItem
    Created SRC_TEST_JAVA\com\toolkit\entities\cilogs\CiLogTyp eFKItemDataOnDemand.java
    Created SRC_TEST_JAVA\com\toolkit\entities\cilogs\CiLogTyp eFKItemIntegrationTest.java
    Created SRC_TEST_JAVA\com\toolkit\entities\cilogs\CiLogTyp eFKItemDataOnDemand_Roo_Configurable.aj
    Undo create SRC_TEST_JAVA\tls\toolkit\entities\cilogs\CiLogTyp eFKItemDataOnDemand_Roo_Configurable.aj
    Undo create SRC_TEST_JAVA\com\toolkit\entities\cilogs\CiLogTyp eFKItemIntegrationTest.java
    Undo create SRC_TEST_JAVA\tls\toolkit\entities\cilogs\CiLogTyp eFKItemDataOnDemand.java
    Persist method required
    ~.entities.cilogs.CiLogTypeFKItem roo>

    Any ideas?

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

    Default

    Can you please turn the @RooEntity annotation back to normal, execute "development mode", change @RooEntity back to the error mode, then log an issue at https://jira.springsource.org/browse/ROO with the resulting stack trace? Thanks!
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  7. #7
    Join Date
    Nov 2008
    Posts
    27

    Default

    Quote Originally Posted by Ben Alex View Post
    Can you please turn the @RooEntity annotation back to normal, execute "development mode", change @RooEntity back to the error mode, then log an issue at https://jira.springsource.org/browse/ROO with the resulting stack trace? Thanks!
    Created, see ROO-687

    Cheers

    Tim

Posting Permissions

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