diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-25 15:52:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-25 15:52:26 +0200 |
commit | 0a6a2fe64508497d287aa3341e667fe313912774 (patch) | |
tree | 72fa2a87eb3631438c0b14fd167349dc3492857d /odb/relational/oracle/source.cxx | |
parent | 62c19a34f1b32f084845ea51eba9b6fb910ef66b (diff) |
Simplify auto id implementation in Oracle
Specifically, instead of using a trigger to assign the next id from the
sequence, get the next value directly in the INSERT statement.
Diffstat (limited to 'odb/relational/oracle/source.cxx')
-rw-r--r-- | odb/relational/oracle/source.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/odb/relational/oracle/source.cxx b/odb/relational/oracle/source.cxx index cfbdbac..780dc06 100644 --- a/odb/relational/oracle/source.cxx +++ b/odb/relational/oracle/source.cxx @@ -19,10 +19,7 @@ namespace relational struct query_parameters: relational::query_parameters { - query_parameters (base const& x) - : base (x), i_ (0) - { - } + query_parameters (base const& x): base (x), i_ (0) {} virtual string next () @@ -33,6 +30,14 @@ namespace relational return ss.str (); } + virtual string + auto_id () + { + // The same sequence name as used in schema.cxx. + // + return quote_id (table_ + "_seq") + ".nextval"; + } + private: size_t i_; }; @@ -509,11 +514,6 @@ namespace relational class_ (base const& x): base (x) {} virtual void - init_auto_id (semantics::data_member&, string const&) - { - } - - virtual void init_image_pre (type& c) { if (options.generate_query () && |