Hi all,
How can I reverse engineer my tables so the members are protected instead of private? This must be a common thing: we often regenerate our tables, and I have to manually add any derived fields, which is very time consuming. I'd prefer to extend from the generated model and put my derived fields there, so I can easily replace old generated models with new ones without having to merge derived and nonderived fields every time.
Example: generated Customer model has customerId, customerNameE (english), and customerNameF (french). My derived field is customerName, so I can do
public String getCustomerName() {
return (this.getLocale().equals(LocaleIF.LOCALE_EN_CA) ? getCustomerNameE() :getCustomerName());
}
and reference customerName in my .jsp.
If I simply extend from generated model (public class LocalizedCustomer extends Customer) I don't have access to the private members of the class anymore.
Any help gratefully appreciated.
Hibernate version: 3.2.6GA
Name and version of the database you are using: Oracle 10g
|