diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-10-14 14:34:51 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-10-14 14:34:51 +0200 |
commit | 25f9d60705e54c77704404a19001dc6711227bef (patch) | |
tree | ec0186d86e6e0fb16df1a5954e4a3e305e9d27a1 /odb/oracle/traits.hxx | |
parent | bbac9d4b7e9015811ad3dd3d49024981e7fce73d (diff) |
Handle mapping of std::vector<char> to Oracle SQL type RAW by default
Diffstat (limited to 'odb/oracle/traits.hxx')
-rw-r--r-- | odb/oracle/traits.hxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/odb/oracle/traits.hxx b/odb/oracle/traits.hxx index d156fb3..efe35b1 100644 --- a/odb/oracle/traits.hxx +++ b/odb/oracle/traits.hxx @@ -582,6 +582,33 @@ namespace odb { }; + // std::vector specialization for RAW. + // + template <> + struct default_value_traits<std::vector<char>, id_raw> + { + public: + typedef std::vector<char> value_type; + typedef std::vector<char> query_type; + typedef lob_callback image_type; + + static void + set_value (value_type& v, const char* b, std::size_t n, bool is_null) + { + if (!is_null) + v.assign (b, b + n); + else + v.clear (); + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const value_type& v); + }; + // std::string specialization for LOBs. // class string_lob_value_traits |