You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by "Wang, Kevin" <KW...@TMRS.org> on 2003/10/01 18:15:43 UTC

Using Torque to generate value class/JavaBeans

Our project uses CMP for persistance with WebSphere Application Server. It
also uses value classes (JavaBean) to assist the process. There is
one-to-one mapping between CMPs and db tables/views, and for the most part
one-to-one match between CMPs and value classes. Since value classes are
just plan JavaBeans with getter/setter for each table field. It would be
wise to generate them from tables/views and vise versa.

Can you achieve this with Torque? Without deep understanding of Torque, I
think it can be done by using a combination of Torque and Castor, plus
additional value class generator (VCGenerator , to be created). The
schema.xml generated by Torque can be fed to VCGenerator to create the value
class. Castor can be used to generate the helper classes to assist the
VCGenerator. For Castor to work in this case, an xml version of the Torque
dtd (database.dtd) would need to be converted.

Is there any other tool out there that will do such simple task?

Thanks,
Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org