diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-10 15:17:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-10 15:17:16 +0200 |
commit | b8554760aa3a5c5697c77d11e507a2bb46dbf8e4 (patch) | |
tree | 3f2bcb28a59eb0d4cce4586acec4a8c639cde7e6 /odb/relational/source.cxx | |
parent | 1b64460a2b2c5411b6052cd4c4d8e8b0d46a4086 (diff) |
Add support for custom database type mapping
New pragma qualifier, map, and specifiers: as, to, from. New tests:
<database>/custom.
Diffstat (limited to 'odb/relational/source.cxx')
-rw-r--r-- | odb/relational/source.cxx | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/odb/relational/source.cxx b/odb/relational/source.cxx index 0a77b74..adc7a0e 100644 --- a/odb/relational/source.cxx +++ b/odb/relational/source.cxx @@ -577,7 +577,8 @@ traverse_object (type& c) os << endl; os << strlit ((i == b ? " WHERE " : " AND ") + table + "." + - quote_id (i->name) + "=" + qp->next ()); + quote_id (i->name) + "=" + + convert_to (qp->next (), i->type, *i->member)); } if (abst) @@ -650,7 +651,8 @@ traverse_object (type& c) os << endl; os << strlit ((i == b ? " WHERE " : " AND ") + table + "." + - quote_id (i->name) + "=" + qp->next ()); + quote_id (i->name) + "=" + + convert_to (qp->next (), i->type, *i->member)); } os << ";" @@ -689,13 +691,14 @@ traverse_object (type& c) os << endl; os << strlit ((i == b ? " WHERE " : " AND ") + - quote_id (i->name) + "=" + qp->next ()); + quote_id (i->name) + "=" + + convert_to (qp->next (), i->type, *i->member)); } if (optimistic != 0 && !poly_derived) os << endl - << strlit (" AND " + column_qname (*optimistic) + - "=" + qp->next ()); + << strlit (" AND " + column_qname (*optimistic) + "=" + + convert_to (qp->next (), *optimistic)); os << ";" << endl; } @@ -713,7 +716,8 @@ traverse_object (type& c) os << endl << strlit ((i == b ? " WHERE " : " AND ") + - quote_id (i->name) + "=" + qp->next ()); + quote_id (i->name) + "=" + + convert_to (qp->next (), i->type, *i->member)); } os << ";" @@ -733,12 +737,13 @@ traverse_object (type& c) { os << endl << strlit ((i == b ? " WHERE " : " AND ") + - quote_id (i->name) + "=" + qp->next ()); + quote_id (i->name) + "=" + + convert_to (qp->next (), i->type, *i->member)); } os << endl - << strlit (" AND " + column_qname (*optimistic) + - "=" + qp->next ()) << ";" + << strlit (" AND " + column_qname (*optimistic) + "=" + + convert_to (qp->next (), *optimistic)) << ";" << endl; } } |