-->
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.  [ 7 posts ] 
Author Message
 Post subject: (Xdoclet2) Non public properties?
PostPosted: Fri Dec 12, 2003 9:12 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
Shall I look for their getters?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 9:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Absolutely. Hibernate doesn't require that properties are public.

Perhaps, now that we support

Code:
<property access="field" ... />


you also need to look at instance variables?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 10:11 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
gosh. that would be tricky...

What Shall I look for?

1. Properties ( tag on getter )
2. Instance variables ( what if somebody marks instance variable, and property getter? , and instance variables do not need to follow any naming rules... so I can not determine that it is the same property...

what with inheritance? normally I shall include properties from superclasses, but stop on those which are actually mapped...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 8:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ko5tik wrote:
1. Properties ( tag on getter )
2. Instance variables ( what if somebody marks instance variable, and property getter? , and instance variables do not need to follow any naming rules... so I can not determine that it is the same property...


If they mark it twice, it's their problem!
If they really don't mean it - they are problably mapping to the same column and then hibernate will catch the error and say you are mapping a column twice.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 10:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I think that you should have a rule like:


Code:
/**
* @hibernate.property
*/
public String getFoo() {.... };


results in:

Code:
<property name="foo" type="string"/>





Code:
/**
* @hibernate.property
*/
private String foo;


results in:

Code:
<property name="foo" type="string" access="field"/>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2003 10:41 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
That's will be tricky... But my jelly skills are improving really fast...

While we are at it, what is access parameter for?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2003 10:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
access=field tells Hibernate to use direct field access for getting the property, while leaving it out will result in get/set Methods to be used.


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