Announcement Announcement Module
Collapse
No announcement yet.
How to remove a field? Difference between field reference and field other? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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)

    Comment


    • #3
      Thank you Ben.

      Comment

      Working...
      X