diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-19 13:42:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-19 13:42:18 +0200 |
commit | 72951cb80852683bdd2707031471580620733e2f (patch) | |
tree | c5bf96a9a4298c4c78f8bcf267d699c64106db73 /schema/custom | |
parent | 261936f0f24a40276116a4ce1f0707d16754c5ae (diff) |
New design for NULL semantics
Now, instead of being specified as part of the SQL type with the type
pragma, there are separate null and not_null pragmas. The not_null
pragma was used to control NULL-ness of object pointers. Now the two
pragmas are used consistently for object pointers and simple values
(and in the future will work for composite values and containers).
Diffstat (limited to 'schema/custom')
-rw-r--r-- | schema/custom/employee.hxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/schema/custom/employee.hxx b/schema/custom/employee.hxx index 742ad42..651f8c3 100644 --- a/schema/custom/employee.hxx +++ b/schema/custom/employee.hxx @@ -43,10 +43,10 @@ public: private: friend class odb::access; - #pragma db type("VARCHAR(255) NOT NULL") column("first_name") + #pragma db type("VARCHAR(255)") column("first_name") std::string first_; - #pragma db type("VARCHAR(255) NOT NULL") column("last_name") + #pragma db type("VARCHAR(255)") column("last_name") std::string last_; }; @@ -70,7 +70,7 @@ private: employer () {} - #pragma db id type("VARCHAR(255) NOT NULL") column("name") + #pragma db id type("VARCHAR(255)") column("name") std::string name_; }; @@ -133,14 +133,14 @@ private: employee (): name_ ("", "") {} - #pragma db id type("INTEGER UNSIGNED NOT NULL") column("ssn") + #pragma db id type("INTEGER UNSIGNED") column("ssn") unsigned long id_; #pragma db column("") // No column prefix. name_type name_; #pragma db unordered table("EmployeeDegree") id_column("ssn") \ - value_type("VARCHAR(255) NOT NULL") value_column("degree") + value_type("VARCHAR(255)") value_column("degree") degrees_type degrees_; #pragma db not_null column("employer") |