Results 1 to 2 of 2

Thread: @PreRemove in .java file

  1. #1
    Join Date
    Jul 2010
    Posts
    1

    Default @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. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    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.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Posting Permissions

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