ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Hall" <JH...@cihi.ca>
Subject RE: Inserting Default values if object member is null
Date Mon, 14 Nov 2005 19:09:11 GMT
Yah, but the db column is set to not null, so you would get a database
I've tried that anyhow, and got that not null error.  I believe the
nullValue is used for a replacement to insert a null value not to define
a default in the
event the object property is null.


From: Nathan.Maves@Sun.COM [mailto:Nathan.Maves@Sun.COM] 
Sent: Monday, November 14, 2005 2:05 PM
To: user-java@ibatis.apache.org
Subject: 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. 


On Nov 14, 2005, at 11:16 AM, Jason Hall wrote:

	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 database default.

View raw message