-->
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.  [ 4 posts ] 
Author Message
 Post subject: Column Name Constants?
PostPosted: Fri Sep 03, 2010 11:31 am 
Newbie

Joined: Fri Sep 03, 2010 11:27 am
Posts: 2
Is there a way for the reverse engineering tool to generate constants for column names?

For example:

public static final String MY_COLUMN_NM = "MY_COLUMN_NM";

I would like to occasionally write SQL queries without using column name literals.

Thanks!


Top
 Profile  
 
 Post subject: Re: Column Name Constants?
PostPosted: Fri Sep 03, 2010 2:26 pm 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
Its more or less like using reflections. Could you brief me how this constant file will help u

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


Top
 Profile  
 
 Post subject: Re: Column Name Constants?
PostPosted: Tue Sep 07, 2010 4:51 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
There is meta attribute "default-value", but you should manually specify default value for each property you want.
Or you could modify PojoFields.ftl template.
Use what is better for you.


Top
 Profile  
 
 Post subject: Re: Column Name Constants?
PostPosted: Tue Sep 07, 2010 10:06 am 
Newbie

Joined: Fri Sep 03, 2010 11:27 am
Posts: 2
Thanks all. I'll give that a shot. The constants are just a nice thing to have in cases where we want to run standard SQL queries. You can avoid using string literals and track when there are schema changes at compile time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.