-->
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.  [ 5 posts ] 
Author Message
 Post subject: Accessor naming convenion problem...
PostPosted: Tue Jan 03, 2006 7:49 am 
Newbie

Joined: Mon Apr 26, 2004 3:48 am
Posts: 18
Location: Istanbul, Turkiye
Hi all,

Think that i have member field mSomeValue in an Object. I am generating code from hibernate config file via ant tasks and it names the setter and getter as:

getmSomeValue
setmSomeValue

i supposed this is a bug play a bit with BasicPOJOClass.java to make some changes for generatiing the code as our project requires (method parameters starts with a, for example),

anyway now hibernate complains that cant find a getter for member xxx,

Even more interestingly Idea does the same thing while auto-generating the accessors but Eclipse not.

So is this a bug or is there something more I dont know about Javabean naming conventions.

Sorry for taking your time with strange topic, I dont like the convention, but whatever.

_________________
a y


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 7:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
This has been discussed quite a bit in the past. You need to read up on Java Bean standards as there are some minor (My words) Quirks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 3:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
The issue with this users problem is that he want us to generate mSomeValue when the property name is MSomeValue which require a concept like a "namingstrategy" for code generation since it is not as simple as just lower casing the first letter since that would be wrong in case of e.g. URL.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 3:25 am 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Yep,

I agree with Max in some cases we are forced to make the first letter to LowerCase.

What will be the ideal solution?

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 3:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have a naming strategy or something similar, but this is *really* minor in my book - has to be user/community contributed.

_________________
Max
Don't forget to rate


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