Re: Java Plugin / JavaClass.vm
"M.-Leander Reimer" <[email protected]>
| Newsgroups | gmane.comp.java.ejb.middlegen.user |
|---|---|
| Organization | Techdivision GdbR |
| Message-ID | <[email protected]> |
Hi Mario,
I think with the Java plugin you can use something like
${column.javaType} to get the preferred Java type for the current DB
column. Have a look at the source of middlegen/javax/JavaColumn.java and
all its getter methods.
Leander
Mario Laureti schrieb:
> Hello,
>
> I use Middlegen to generate xml file for hibernate out of a database schema.
> I would also like to generate Java source class with setters and getters for every database table from the database schema.
>
> The following is how I am doing this:
>
> I am using a java plug in.
> I wrote a small template.
>
> Is this the right way to do this?
>
> If yes, here is my problem:
>
> Only the context objects $table and $tables are available. It would be nice to have
> a $javaTable in the context to know which Java types to use to generate the Java class.
>
> For now I am hard coding this information in the template and I do not feel that it is the right thing to do...
>
> Can any one guide me in the right direction? I have attached the template I started.
>
> Thanks
>
> Mario Laureti
>
>
>
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click