Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set NULL values in CF9 ORM

Is there a way to get CF9 ORM to insert NULL Values into the database rather than an empty string?

I've got a numeric field which can be null, but throws an error because it's trying to enter ''.

like image 356
sebduggan Avatar asked Aug 17 '10 19:08

sebduggan


1 Answers

Either:

yourEntity.setNumber(javacast("null",""));

or, add a removeNumber method:

function removeNumber()
{
    structDelete(variables,"number");
}
like image 126
Henry Avatar answered Nov 01 '22 08:11

Henry