Mar 8th, 2010, 06:05 AM
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?
Mar 8th, 2010, 06:14 AM
ok, I found #ROO-589: "Setting method names to blank on @RooEntity does not prevent those methods from being generated"
Originally Posted by tim.taylor
How do I get my script to generate the RooEntity annotation such as:
@RooEntity(persistMethod="", removeMethod="", mergeMethod=""
Appologies if this is obvious.
Mar 8th, 2010, 09:38 AM
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?
Mar 8th, 2010, 05:27 PM
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.
Mar 9th, 2010, 01:47 AM
Originally Posted by Ben 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.
[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
Mar 9th, 2010, 04:23 PM
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!
Mar 10th, 2010, 02:34 AM
Created, see ROO-687
Originally Posted by Ben Alex