Default value not being persisted. Save of new object.

Posts   
 
    
CGLock
User
Posts: 17
Joined: 03-Jun-2007
# Posted on: 18-Oct-2008 04:25:01   

MySql 5.0 LLBLGen V2.6 Final VS 2008 C#

I have a MySql table that contains a field 'PhotoSize', it is 'not null' and has no default value. I believe LL use to by default pass the 'default .net value', in this case 0 as the type is integer, when the object is being persisted yet the value has not been set. However now LL is not passing any value for the PhotoSize field when saving the object.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Oct-2008 14:39:24   

Here is how it works: 1- You have a non-nullable field in the database, without a default value. 2- LLBLGen Pro doesn't attempt to set a field in an Insert or Update statement if that field's value hasn't been changed.

Please post post some code snippet of your test. Also the LLBLGen RuntimeLibraries version and MySqlDirect.Net build version.

David Elizondo | LLBLGen Support Team