Re: Inserting Default values if object member is null

2005-11-14 Thread Michael Campbell
On 11/14/05, Larry Meadors <[EMAIL PROTECTED]> wrote: > Uhm, use a database default? Maybe. Don't all databases error on setting a non-nullable, defaulted column to null? (as opposed to not setting it at all).

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
: Inserting Default values if object member is null Well the best bet now would be to initialize the java bean with a default value, i.e. -1. On Nov 14, 2005, at 12:56 PM, Jason Hall wrote: > Okay, > > Just wanted to know, an afilliate of mine wanted to know. > > Thanks, > >

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
PROTECTED] On Behalf Of Larry Meadors Sent: Monday, November 14, 2005 2:53 PM To: user-java@ibatis.apache.org Subject: Re: Inserting Default values if object member is null On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote: maybe ibatis should support this. I disagree. IMO this is somethin

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
Okay, Just wanted to know, an afilliate of mine wanted to know. Thanks, JH. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Larry Meadors Sent: Monday, November 14, 2005 2:53 PM To: user-java@ibatis.apache.org Subject: Re: Inserting Default values if

Re: Inserting Default values if object member is null

2005-11-14 Thread Larry Meadors
On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote: > > maybe ibatis should support this. I disagree. IMO this is something that should live inthe service/ business logic layer (if it is an application rule), or in the database (if it is an enterprise rule). Putting it in iBATIS (an itegration po

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
maybe ibatis should support this. From: Niels Beekman [mailto:[EMAIL PROTECTED] Sent: Monday, November 14, 2005 2:34 PMTo: user-java@ibatis.apache.orgSubject: RE: Inserting Default values if object member is null You are right, you can’t, because there is no need, since the database

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
user-java@ibatis.apache.orgSubject: Re: Inserting Default values if object member is null BTW you could also do it inline insert into A (col1,col2) values (#col1:NUMERIC:-1#, #col2:VARCHAR:NO_ENTRY# This can be found on page 20 of the developers guide On Nov 14, 2005, at 12:09 PM, Jason

RE: Inserting Default values if object member is null

2005-11-14 Thread Niels Beekman
t: RE: Inserting Default values if object member is null You should use the DTD (http://ibatis.apache.org/dtd/sql-map-2.dtd). The property is actually nullValue, in your example:   When iBATIS finds -999 in the Dummy.id-property it will insert null into the database, when null is found in the dat

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
BATIS will put -999 in the Dummy.id-property.   From: Jason Hall [mailto:[EMAIL PROTECTED] Sent: maandag 14 november 2005 20:26To: user-java@ibatis.apache.orgSubject: RE: Inserting Default values if object member is null   I tried using null property and i get and sqlmapconfig parsing

RE: Inserting Default values if object member is null

2005-11-14 Thread Niels Beekman
-property.   From: Jason Hall [mailto:[EMAIL PROTECTED] Sent: maandag 14 november 2005 20:26 To: user-java@ibatis.apache.org Subject: RE: Inserting Default values if object member is null   I tried using null property and i get and sqlmapconfig parsing error - "null" not a vali

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
-java@ibatis.apache.orgSubject: Re: Inserting Default values if object member is null You can specify your insert sqlmap to use a ParameterMap and set the nullValue property on the specific column. Nathan On Nov 14, 2005, at 11:16 AM, Jason Hall wrote: Hi,   I just want to know if an object m

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
Sent: Monday, November 14, 2005 2:05 PMTo: user-java@ibatis.apache.orgSubject: Re: Inserting Default values if object member is null You can specify your insert sqlmap to use a ParameterMap and set the nullValue property on the specific column. Nathan On Nov 14, 2005, at 1

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
PMTo: user-java@ibatis.apache.orgSubject: Re: Inserting Default values if object member is null You can specify your insert sqlmap to use a ParameterMap and set the nullValue property on the specific column. Nathan On Nov 14, 2005, at 11:16 AM, Jason Hall wrote: Hi,   I just want to know if an object member

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 14, 2005 2:05 PMTo: user-java@ibatis.apache.orgSubject: Re: Inserting Default values if object member is null You can specify your insert sqlmap to use a ParameterMap and set the nullValue property on the specific column. N

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
You can specify your insert sqlmap to use a ParameterMap and set the nullValue property on the specific column.NathanOn Nov 14, 2005, at 11:16 AM, Jason Hall wrote: Hi,   I just want to know if an object member is set to null and the database column is configured as not null, is there a way in th

Re: Inserting Default values if object member is null

2005-11-14 Thread Larry Meadors
dors > Sent: Monday, November 14, 2005 1:20 PM > To: user-java@ibatis.apache.org > Subject: Re: Inserting Default values if object member is null > > Uhm, use a database default? > > Larry > > > On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote: > > > >

RE: Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
] [mailto:[EMAIL PROTECTED] On Behalf Of Larry Meadors Sent: Monday, November 14, 2005 1:20 PM To: user-java@ibatis.apache.org Subject: Re: Inserting Default values if object member is null Uhm, use a database default? Larry On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote: > > Hi, > &

Re: Inserting Default values if object member is null

2005-11-14 Thread Larry Meadors
Uhm, use a database default? Larry On 11/14/05, Jason Hall <[EMAIL PROTECTED]> wrote: > > Hi, > > I just want to know if an object member is set to null and the database > column is configured as not null, > is there a way in the sqlmapconfig.xml to set a default value say -1 in a > parameter ma

Inserting Default values if object member is null

2005-11-14 Thread Jason Hall
Hi,   I just want to know if an object member is set to null and the database column is configured as not null, is there a way in the sqlmapconfig.xml to set a default value say -1 in a parameter map. I've used nullValue but this is not exactly what i want. I need a default value like a da