Ok, sorry..I will use MyBatis Generator in future !! Can I change the subject of my post?
Many other tools/frameworks need such fields. For example JavaFX TableView ....common BeanUtils class...etc.
When this is not possible via MyBatis Generator...I must create/maintain this field names in an other way. It would be enough when it is possible to enable it in MyBatis Generator.
public TableView getTableView() {
ObservableList<Person> data = FXCollections.<Person>sequence(
new Person("Duke", "Java"),
new Person("DukeFX", "JavaFX"));
TableView<Person> tableView = new TableView<Person>();
tableView.setItems(data);
TableColumn firstNameCol = new TableColumn("First");
firstNameCol.setProperty(Person.FIRSTNAME);
TableColumn lastNameCol = new TableColumn("Last");
lastNameCol.setProperty(Person.LASTNAME);
tableView.getColumns().addAll(firstNameCol, lastNameCol);
return tableView;
}
public class Person implements Bean {
public static final String FIRSTNAME = "firstName";
public static final String LASTNAME = "lastName";
private String firstName;
private String lastName;
public Person(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
//with getters and other Bean functionality
...
}