-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How To Generate Protected members?
PostPosted: Fri Sep 26, 2008 3:47 pm 
Newbie

Joined: Fri Sep 05, 2008 9:58 am
Posts: 5
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2008 4:05 pm 
Newbie

Joined: Fri Sep 05, 2008 9:58 am
Posts: 5
To follow up on this more generally, how do developers manage this sort of situation, where generated POJOs need to be merged with derived\hand coded fields and methods?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 11:19 am 
Newbie

Joined: Fri Sep 05, 2008 9:58 am
Posts: 5
Anyone?...:-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.