db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bernard.n...@vallourec.fr
Subject Réf. : primitive null values
Date Wed, 31 Aug 2005 06:28:54 GMT

For me, the easies way to solve your problem is to add javaType="object" to
your column property. Your columns will be mapped with Integer object (or
others depending on the kind of database field) so you will be able to set
null values for columns.

<column
      name="reference"
      type="INTEGER"
     javaType="object"
/>

You can also specify a defaultJavaType="Object" in the database tag to
apply this for all your fields.

Bon courage,

Bernard



                                                                                         
                          
                    "Stan                                                                
                          
                    Wiechers"            Pour :  "Apache Torque Users List" <torque-user@db.apache.org>
            
                    <Stan@rga.com        cc :                                         
                             
                    >                    Objet :      primitive null values           
                             
                                                                                         
                          
                    30/08/2005                                                           
                          
                    17:37                                                                
                          
                    Veuillez                                                             
                          
                    répondre à                                                         
                            
                    "Apache                                                              
                          
                    Torque Users                                                         
                          
                    List"                                                                
                          
                                                                                         
                          
                                                                                         
                          




Hey,

so I'm binding a sql file to a schema xml and that to the generated classes
for a oracle db.  I have a bunch of Integer columns in my table which can
be null, however since the Integer column is bound to a primitive int I see
now way of saying null.

So I guess my question is do I need to change mapping of certain oracle
types to a java objects like java.lang.Integer rather then primitives? If
yes, what is the easiest way to achieve that? And shouldn't that be default
behaviour?

Looking forward to hear back from you guys,
Stan


This message is the property of R/GA and contains information which may be
privileged or confidential. It is meant only for the intended recipients
and/or their authorized agents. If you believe you have received this
message in error, please notify us immediately by return e-mail or by
forwarding this message to postmaster@rga.com, and destroy any printed or
electronic copies of the message. Any unauthorized use, dissemination,
disclosure, or copying of this message or the information contained in it,
is strictly prohibited and may be unlawful. Thank you.


This message is the property of R/GA and contains information which may be
privileged or confidential. It is meant only for the intended recipients
and/or their authorized agents. If you believe you have received this
message in error, please notify us immediately by return e-mail or by
forwarding this message to postmaster@rga.com, and destroy any printed or
electronic copies of the message. Any unauthorized use, dissemination,
disclosure, or copying of this message or the information contained in it,
is strictly prohibited and may be unlawful. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org




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


Mime
View raw message