tizen 2.4 release
[framework/web/wrt-commons.git] / modules / db / include / dpl / db / orm_generator.h
@@ -35,8 +35,8 @@
 #define DPL_ORM_GENERATOR_H
 
 
+#include <boost/optional.hpp>
 #include <dpl/string.h>
-#include <dpl/optional.h>
 #include <dpl/type_list.h>
 #include <dpl/db/sql_connection.h>
 #include <dpl/db/orm.h>
@@ -84,7 +84,7 @@ namespace ORM {
 
 #define SQL(...)
 #define TABLE_CONSTRAINTS(...)
-#define OPTIONAL(type) DPL::Optional< type >
+#define OPTIONAL(type) boost::optional< type >
 #define DATABASE_START(db_name)                                 \
     namespace db_name                                           \
     {                                                           \
@@ -182,7 +182,7 @@ namespace ORM {
 
 #define CREATE_TABLE(name) std::ostream& name::operator<<(std::ostream& ostr, const RowBase& row) { using ::operator<< ; ostr << STRINGIFY(name) << " (";
 #define COLUMN_NOT_NULL(name, type, ...) ostr << " '" << row.name << "'" ;
-#define COLUMN(name, type, ...)          ostr << " '" << row.name << "'" ;
+#define COLUMN(name, type, ...)          if (!!(row.name)) { ostr << " '" << *(row.name) << "'"; } else { ostr << " '" << "NULL" << "'"; }
 #define CREATE_TABLE_END() ostr << " )" ; return ostr; }
 
 #include ORM_GENERATOR_DATABASE_NAME_LOCAL