Currently there isn't any automatic way to customize reverse engineering. It seems a good improvement, please create the request at https://jira.springsource.org/browse/ROO
Spring roo - telling dbmanaged entities to remove the "Id" suffix from the foreign key method name
-
27-09-2022 - |
Pregunta
Spring roo creates foreign key entities like this:
In the Contact_Roo_DbManaged.aj
@ManyToOne
@JoinColumn(name = "CONTACT_ID", referencedColumnName = "CONTACT_ID")
private Contact Booking.contactId;
public Contact Booking.getContactId() {
return contactId;
}
public void Booking.setContactId(Contact contactId) {
this.contactId = contactId;
}
In the table, the field name is CONTACT_ID but in my java objects I don't want to see the Id on the end of the name because it is actually returning a Contact object. Is there a way to get around this other than pulling in every join column and redefining the variable name? I did not have this issue with hibernate tools as it automatically remove the Id from the end of the field name.
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow