Hi Jonathan,
If I remember correctly, the 'Types' specified in Sql2Java are integer types.  I would 
recommend doing some debugging to see what Pgsql lists it as in Middlegen. This may be 
a case that it will not have a specific type for Inet and it will only identify as an 
Object.  You may have to change the preferred Type.Object to map to a String or 
whatever you may want to use those IP addresses as in Hibernate. This doesn't help if 
you have true Objects in your database, but at least it's a work-around to keep you 
moving forward!
 
my two cents,
-D
 

        -----Original Message----- 
        From: Jonathan Scott [mailto:[EMAIL PROTECTED] 
        Sent: Thu 8/12/2004 10:29 PM 
        To: [EMAIL PROTECTED] 
        Cc: 
        Subject: Re: AW: [Middlegen-user] mapping DB types to Java types
        
        

        Darren,
        
        Thanks for the information. I have tried playing around with it a little. I 
just tried to confirm my overriding of the getPreferredType() was working, and that 
was just not going at all.
        
        I noticed the code below as well. However, my problem comes about from the 
fact that Types does not contain an IP Address type. So, how I would be able to 
accomplish the below, in the specific case of PG's "inet" type, and map it to a class 
of my own, is not exactly apparent to me.
        
        Perhaps I need to hard code for each field, in a script, to modify my 
properties file. Would be preferred to just be able to override getPreferredType(), 
instead of doing something funky like sed'ing the properties file. I'd prefer to just 
be able to play around with my sql files, run ant, and see the classes all built 
properly and my tests running all green.
        
        Jonathan Scott
        
        
        

<<winmail.dat>>

Reply via email to