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: Field-to-method mapping for fields like "yAxis"?
PostPosted: Mon Sep 18, 2006 9:43 am 
Newbie

Joined: Mon Sep 18, 2006 9:23 am
Posts: 4
Location: Durham, UK
I've got a set of classes which contain objects with names like yAxis, which are accessed through get/setYAxis(...) methods (note the capitalisation). When I attempt to map these fields with something like
Code:
<many-to-one name="yAxis" class="cedar.hepdata.model.YAxis"/>
I get a runtime error about not being able to find getter/setter methods for "yAxis". This implies that the capitalise-first-letter-of-field-name rule isn't being applied if the second letter is capitalised, and indeed if I change the field name to the non-standard "YAxis" in the source and the mapping file then it works. I'd rather not do this, though, and legacy code issues mean that we can't use a field name of "yaxis" and get/setYaxis methods either.

Anyway, I couldn't find this "don't-capitalise-if-second-letter-is-capital" behaviour described in the Hibernate or JavaBean documentation: the closest I found was that no change should apply if both the first two letters are capitals. Is there a way of forcing Hibernate to do what I want and is this the expected behaviour?

Thanks!
Andy

PS. I'm using Hibernate 3, before someone asks! Not entirely sure about the minor version, but I can't see any references to this issue in recent change lists.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 18, 2006 10:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the property name *is* YAxis so what is the problem with that ?

YAxis should work with both get/setYAxis methods and field yAxis (which is only relevant if you have access="field")

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 18, 2006 11:43 am 
Newbie

Joined: Mon Sep 18, 2006 9:23 am
Posts: 4
Location: Durham, UK
max wrote:
the property name *is* YAxis so what is the problem with that ?

YAxis should work with both get/setYAxis methods and field yAxis (which is only relevant if you have access="field")


Ah, from the example in the manual I thought the property name used the same naming convention as the field. The field name being a mangled form of the property name makes more sense. Thanks!

Andy


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.