I am using Oracle. I doubt that is the problem though. Looking through the Middlegen source code, as far as I can tell, the method that determines the Java type is the Sql2Java.getPreferredJavaType(int sqlType, int size, int decimalDigits) method. Notice that whether a column is nullible or not is not even passed in and is not a determining factor in the final datatype.
I wish there was a way to override this method, and also pass in whether the column is nullible. Perhaps by specifying the class name in the middlegen ant task and implementing some interface, my custom method would be called instead of Sql2Java.getPreferredJavaType(). Is there a way already to do this? At the least, is there a way to specify that you only want middlegen to return wrappers for primitives but not primitives themselves? I am thinking about implementing such functionality on my own if it is not already available. Is this something other users would find useful? Thanks, Daniel >>> [EMAIL PROTECTED] 12/16/03 07:59AM >>> I don't know how to do what you ask. However, I had similar problems running with the PostgreSql driver that shipped with Middlegen. I upgraded to the latest jdbc driver and those problems went away. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Rosenbaum Sent: Monday, December 15, 2003 1:56 PM To: [EMAIL PROTECTED] Subject: [Middlegen-user] Changing class the determines Data type Is there a way to specify a custom class that determines the data type of a db table column? I am using middlegen with the Hibernate plugin and the default choices do not map well for Hibernate usage. For example, it may choose a nullible integer column to be a java int, while it should really be an Integer since it is nullible. Therefore it would be nice if I can implement some interface that passes in the SQL type and I would return the datatype I would like to use. Is there functionality for this already? Thanks, Daniel ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user
