I've got one class in my application that Roo keeps making the properties "final" on. Of course that removes the setter and seems to remove a finder too.

The class is a pretty simple Notes class with two properties (name, text). There are two OneToMany Sets supported by a NotesIngredient Class that let you know:
  • Ingredient notes, if the note is a set of notes;
  • Note sets that a particular note is part of.


If I go in an reset things to just "private", e.g. "private String name; private String text", etc. things are fine. But the next time I make any kind of significant change in the Roo Shell, it changes all the properties back to final, and removes the annotated finder "findNotesByNameEquals".

Any idea what's up or how I can fix this?

I tried to attach the Notes.java and NotesIngred.java files, but had problems so I'm including the gist of them below.

Thanks! Richard

Note.java
Code:
@Audited
@RooJavaBean
@RooToString
@RooJpaActiveRecord(finders = { "findNotesByNameEquals" })
public class Note extends BaseObject implements Comparable<Note> {

	@NotNull
	@Column(unique = true)
	@Size(min = 2, max = 30)
	private final String name;

	@Size(min = 0, max = 4096)
	private final String text;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "parentNote")
	private final Set<NoteIngred> ingredients = new HashSet<NoteIngred>();

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "ingredNote")
	private final Set<NoteIngred> noteSets = new HashSet<NoteIngred>();

	public Note(String name, String text) {
		super();
		this.name = name;
		this.text = text;
	}

        // hasCode, equals, compareTo and a couple of customfinders follow, but ommitted.
}
NoteIngred.java
Code:
@Audited
@RooJavaBean
@RooToString
@RooJpaActiveRecord
@Table(name="note_ingred",
uniqueConstraints=
@UniqueConstraint(columnNames={"parent_note", "seq"})
		)
public class NoteIngred extends BaseObject implements Comparable<NoteIngred> {

    @NotNull
    @ManyToOne
    private Note parentNote;

    @NotNull
    private Integer seq;

    @NotNull
    @ManyToOne
    private Note ingredNote;

    // hasCode, equals, compareTo follow, but ommitted.

}