-->
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: Component Properties
PostPosted: Thu Jan 08, 2004 6:23 am 
Regular
Regular

Joined: Tue Jan 06, 2004 3:32 pm
Posts: 80
Location: Munich, Germany
How do I declare the properties of component, so XDoclet generates a fragment like this:

<component name="name" class="Name">
<property name="firstName"/>
<property name="initial"/>
<property name="lastName"/>
</component>

I've already added

@hibernate.component class="Name"

to the getter/setter in my parent class (User). Now XDoclet generates

<component name="name" class="Name">
</component>

I was supposing that I would have to add tags to the component class itself, like @hibernate.property to every property, but then what would I have to declare at the top of the class? @hibernate.class seems not the way to go, because then XDoclet expects an ID property (which is senseless for a component).

Regards,

Andreas


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2004 6:36 am 
Regular
Regular

Joined: Tue Jan 06, 2004 3:32 pm
Posts: 80
Location: Munich, Germany
I am answering my own question:

It seems as if there is no need to declare anything at class level of the component class.

Regards,

Andreas


Top
 Profile  
 
 Post subject: cant get that working
PostPosted: Tue Feb 24, 2004 11:46 am 
Beginner
Beginner

Joined: Wed Sep 24, 2003 11:06 am
Posts: 21
Location: Denmark
How does that work?
XDoclet doesnt seem to touch the file containing my component class declaration at all.. It is in the same folder as the class using it and XDoclet has been instructed to look at all *.java files...

any ideas?

class using component:
/**
* @hibernate.component class="MassDeviation"
* @return
*/
public MassDeviation getFragmentMassTolerance() {
return fragmentMassTolerance;
}

component class (containing one property for clarity):

public class MassDeviation {

private float deviation;

/**
* @hibernate.property
* @return
*/
public float getDeviation() {
return deviation;
}
}

this gives me the following mapping file (excerpt):

<component name="fragmentMassTolerance" class="MassDeviation">
</component>

as you can see, no component properties...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 25, 2004 5:48 am 
Beginner
Beginner

Joined: Wed Sep 24, 2003 11:06 am
Posts: 21
Location: Denmark
hmm... looks like the problem is the >>class="MassDeviation"<< attribute on the @hibernate.component tag.. If I remove it, the properties are actually generated in the mapping file...


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.