X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=modules%2Fdb%2Finclude%2Fdpl%2Fdb%2Form_generator.h;fp=modules_wearable%2Fdb%2Finclude%2Fdpl%2Fdb%2Form_generator.h;h=2c41e694d915d3d0a2f4361028b667cebe49ad81;hb=3a034abb4dca58ff0940687d8dd2b829ce2e226f;hp=8bd9fdb1abee7cacb7244930c7e550ad41e9cd62;hpb=58be0971049907f3166ce56a6ad509769565158f;p=framework%2Fweb%2Fwrt-commons.git diff --git a/modules_wearable/db/include/dpl/db/orm_generator.h b/modules/db/include/dpl/db/orm_generator.h similarity index 98% rename from modules_wearable/db/include/dpl/db/orm_generator.h rename to modules/db/include/dpl/db/orm_generator.h index 8bd9fdb..2c41e69 100644 --- a/modules_wearable/db/include/dpl/db/orm_generator.h +++ b/modules/db/include/dpl/db/orm_generator.h @@ -35,8 +35,8 @@ #define DPL_ORM_GENERATOR_H +#include #include -#include #include #include #include @@ -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