Announcement Announcement Module
No announcement yet.
Spring Roo/DBRE + Some sort of error accessing a property Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Roo/DBRE + Some sort of error accessing a property

    Here is part of my stack trace: ccountingEntry_aroundBody6( :173) ccountingEntry( ountingEntry(
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

    This is what I've done:

    1- Succesfully did a DBRE process on 4 tables
    2- For two of them Roo, found a primary key, the other two got a [Class]PK, composite key Class. This step its ok according with JPA specification.
    3- I can persist data on the tables that doesn't have the PK (composite primary key workaround)
    4- I've made a Push-In Refactor in those entities with the 'identifierType=[Class]PK.class', to modify them, that was ok.

    I cant set values to those properties, eventhough there's nothing wrong with them, if I see in the code at line 173 I see:

    LegacyTableClass Header = new LegacyTableClass();
    Header.getId().setAnyStringField("any string value");  <---- This part here gives the error.
    As you can see, I think I am doing the things right, when I do

    Header.getId(), I am actually calling an instance of LegacyTableClassPK, with contains the properties, getters and setters, but it doesn't work.

    I don't know what to do, any clues?

  • #2
    Fortunely I've found it, I was wrong when I tried to set the properties of the composite PK Class. The correct way is:

    LegacyTableClass instanceOfLegacyTableClass = new LegacyTableClass();
    LegacyTableClassPK legacyTableClassPk = new LegacyTableClassPK(fieldValue1, fieldValue2, fieldValue3);
    And that's all.