Spring roo - telling dbmanaged entities to remove the "Id" suffix from the foreign key method name

StackOverflow https://stackoverflow.com/questions/21103500

  •  27-09-2022
  •  | 
  •  

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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top