Hi Jonathan, I ran into this problem on a recent project as well. We generated our EJBs through WebSphere Application Developer's bottom up mapping utility and used Middlegen to generate our business objects and struts classes.
The problem was that the type conversion algorithm WSAD used to create EJBs from database tables was different than that used by the Middlegen Java plugin. In particular WSAD makes all CMP fields in an entity bean objects whereas the Java plugin for Middlegen will create fields with primitive types. To work around this problem I would first start Middlegen with the GUI enabled and then shut it down. This would load the preferences file update it, if necessary, and then save it to disk. (prefsdir="./prefs" in middlegen ant task) Once Middlegen had been shut down I would open up the prefs file and do a search and replace on: search : java-type=int replace : java-type=Integer I'm hoping to get some time in the upcoming weeks to make an extension to the Java plugin to allow for a prettier solution. Good Luck Cory Gill -----Original Message----- From: Jonathan Scott [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 9:25 PM To: [EMAIL PROTECTED] Subject: [Middlegen-user] mapping DB types to Java types Hi All, Looking through the MiddleGen site, I am worried it is not at all possible to force certain DB types to specific Java classes. PostgreSQL has a type "inet" which is an IP address. MiddleGen does not understand this type and thus marks it as "Object" in our hbm.xml files. We would like to map it to another class. Is there any configuration file/option etc. that I could use to achieve this? Any pointers would be more than welcome. TIA, Jonathan Scott ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user
