Perfect. That did it. Thanks a lot Karthik.

Kind regards,

Joris








"karthik Guru" <[EMAIL PROTECTED]>

2005-10-10 12:28 PM

Please respond to
"karthik Guru" <[EMAIL PROTECTED]>

To
Joris Wijlens/NYM/SC/[EMAIL PROTECTED]
cc
Subject
Re: Re: [xdoclet-user] Metadata of multiple classes when         multioutput is         true
Classification





 
I have never used hibernate.Is the association represented by some getter method?

say

class Person{
/** @hibernate.blah */
Country getCountry()

}

Now if we get to JavaMethod representation of getCountry(),

JavaMethod.getReturns() returns an instance of com.thoughtworks.qdox.model.Type

type.getJavaClass() -> should get you Country?

Then from there you can do a getNamedParamter of JavaClass for Country?


On Mon, 10 Oct 2005 Joris Wijlens wrote :
>I think my description of my problem was not clear enough.
>
>I have multioutput set to true I'm generating a DAO for the person class.
>The metadata of the person class is in the metadate object of my velocity
>template.
>The person has reference to the country class.
>Now I want to access thje metadata of the country class within the
>template, while generating for the person class.
>
>Joris
>
>
>
>
>
>
>
>
>
>
>
>"karthik Guru" <[EMAIL PROTECTED]>
>2005-10-10 11:30 AM
>Please respond to
>"karthik Guru" <[EMAIL PROTECTED]>
>
>
>To
>Joris Wijlens/NYM/SC/[EMAIL PROTECTED]
>cc
>
>Subject
>Re: [xdoclet-user] Metadata of multiple classes when multioutput is true
>Classification
>
>
>
>
>
>
>
>
>Hi Joris,
>
>Did you think this can work?
>
>javaClass.getNamedParameter("hibernate.class","name")
>OR
>javaMethod.getNamedParameter("hibernate.class","name")
>
>regards,
>karthik
>
>On Mon, 10 Oct 2005 Joris Wijlens wrote :
> >Hi,
> >
> >I have this DAO class that I want to generate. The DAO centers around a
> >pojo, for example Person, with hibernate metadata. In this DAO I want to
> >generate save, update, delete and find  methods for the person object.
>For
> >all the associations of the person object (for example country). I'd like
> >to generate a findAllCountries method in the DAO object. This finder
> >method can be used to fill dropdown selection boxes.
> >
> >The plugin that generates the Dao for the person object has multioutput
> >set to true. So the metadata object that I can access from the Velocity
> >template has only the person object in it !? But now I want to get the
> >name attribute of the hibernate.class tag of the country class for use in
> >the hibernate query to find all the country objects.
> >
> >How do I get a handle to the metadata of other classes when having
> >multioutput set to true?
> >
> >Kind regards,
> >
> >Joris Wijlens
>
>
>



Reply via email to