Results 1 to 3 of 3

Thread: How to remove a field? Difference between field reference and field other?

  1. #1

    Question How to remove a field? Difference between field reference and field other?

    Let's say you have created a field on an entity and now you want to remove it. Which roo command you should use?

    Another question is (sorry for 2 QNs in one thread) what is the difference between those two commands?:

    field reference --fieldName car --type com.demo.Car
    field other--fieldName car --type com.demo.Car

    Thanks for the answers.

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

    Default

    Remove a field by editing the .java file and deleting it. Roo will respond automatically. "field other" is used to add a standard private field into a class. "field reference" is used to add a 'many' side of a M:1 relationship, so it has the JPA annotations added to the field.

    roo> help field other
    Keyword: field other
    Description: Inserts a private field into the specified file

    roo> help field reference
    Keyword: field reference
    Description: Adds a private reference field to an existing Java source file (eg the 'many' side of a many-to-one)
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3

    Default

    Thank you Ben.

Tags for this Thread

Posting Permissions

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