Attribute Names in Generated EJB [message #593278] |
Thu, 15 March 2007 16:57 |
Shelli Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm just learning about EJB3 and have downloaded Eclipse v. 3.3.0 with the
latest WTP plugin. I really like the feature to auto-generate EJB entity
classes from a database. However, I have a concern with how some of the
attributes were named. For example, I have a entity "Account" which
references an "AccountType". It's defined like this in the Account class:
@JoinColumn(name = "ACCOUNT_TYPE_ID", referencedColumnName =
"ACCOUNT_TYPE_ID")
@ManyToOne
private AccountType accountTypeId;
Since "accountTypeId" is actually an instance of AccountType, I would
prefer it be named "accountType". Also, the getter/setter methods:
public AccountType getAccountTypeId() {
return this.accountTypeId;
}
public void setAccountTypeId(AccountType accountTypeId) {
this.accountTypeId = accountTypeId;
}
should be called getAccountType/setAccountType. Other than manually
changing this, is there anything I can do to make this happen when the
class is generated? Since I have 41 entity classes that have been
auto-generated, updating them manually would be very labour intensive.
Thanks in advance!
|
|
|
Powered by
FUDForum. Page generated in 0.03368 seconds