[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ojb-user
Subject:    RE: reverse-Tool with Oracle 8.1.7
From:       Ribi Roland <Roland.Ribi () braunvieh ! ch>
Date:       2004-04-28 14:58:40
Message-ID: 6FC2B4C5FA24D4118DAD00508BC74A5D4D6194 () sbzvzgsrv1 ! braunvieh ! ch
[Download RAW message or body]

I fogot one line:

      int iDecimalDigits = rs.getInt("DECIMAL_DIGITS");

this comes before my other code:

       if(iDataType == java.sql.Types.DECIMAL){
         if(iDecimalDigits>0) {
           iDataType = java.sql.Types.DOUBLE;
         } else {
           iDataType = java.sql.Types.BIGINT;
         }
       }


Roland Ribi


> -----Original Message-----
> From: Ribi Roland [mailto:Roland.Ribi@braunvieh.ch]
> Sent: Wednesday, April 28, 2004 4:57 PM
> To: 'OJB Users List'
> Subject: RE: reverse-Tool with Oracle 8.1.7
> 
> 
> Hi
> 
> I found the specific class and added the follwing code to the class
> org.apache.ojb.tools.mapping.reversedb.DBSchema in the 
> read-method before
> the call of  this.addColumn(...):
> 
>       if(iDataType == java.sql.Types.DECIMAL){
>         if(iDecimalDigits>0) {
>           iDataType = java.sql.Types.DOUBLE;
>         } else {
>           iDataType = java.sql.Types.BIGINT;
>         }
>       }
> 
> It's a simple workaround, perhaps it helps to develope a better
> revers-db-Tool in future...
> 
> Roland Ribi
> 
> > -----Original Message-----
> > From: Ribi Roland [mailto:Roland.Ribi@braunvieh.ch]
> > Sent: Wednesday, April 28, 2004 2:19 PM
> > To: 'ojb-user@db.apache.org'
> > Subject: reverse-Tool with Oracle 8.1.7
> > 
> > 
> > Hi
> > 
> > I would like to use the reverse-tool to genereate the 
> > repository.xml and the
> > java code. 
> > 
> > But the reverse-tool takes always DECIMAL (JDBC-Type) and 
> > Long (Java-Type)
> > for any Number column in Oracle. 
> > How can I override this so that a NUMBER(4) Column is mapped 
> > from BIGINT
> > (JDBC-Type) to Long (Java) and a Column with NUMBER(6,2) is 
> > mapped from
> > DOUBLE (JDBC-Type) to Double (Java)?
> > 
> > Does I need to do this manually or can I declare the mapping in the
> > OJB.properties or does I need to customize a class of OJB and 
> > if yes which
> > one or how?
> > 
> > With the default behavior I get ClasCastExceptions when I try 
> > to get any row
> > from the database.
> > 
> > Roland Ribi
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic