Announcement Announcement Module
Collapse
No announcement yet.
@PreRemove in .java file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @PreRemove in .java file

    I have been messing around with spring roo and I found a reference in the documentation in the field commands section which says when making a One to One relationship you need to add, to the entity containing the fk, a method to remove it from the other class like this:
    Code:
    @PreRemove
    private void Car.preRemove() {
        this.getOwner().setCar(null);
    }
    When I try to add this I get a cannot use this annotation here on the preremove annotation and a error on the . in the method name declaring it is expecting ;. Is this no longer needed or am I putting this in the wrong file?

  • #2
    The Car.remove syntax for methods only works in AspectJ ITDs. In a Java file you define the method in the class Car and don't need that prefix.

    Comment

    Working...
    X