From 6fc9edcb2c54d395ea5d9a77bde882cd8ba9ec03 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Aug 2014 09:37:06 +0200 Subject: Draft implementation for INSERT --- odb/relational/inline.hxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'odb/relational/inline.hxx') diff --git a/odb/relational/inline.hxx b/odb/relational/inline.hxx index ed10e09..76a6763 100644 --- a/odb/relational/inline.hxx +++ b/odb/relational/inline.hxx @@ -217,6 +217,7 @@ namespace relational using semantics::data_member; data_member* id (id_member (c)); + bool auto_id (id && auto_ (*id)); bool base_id (id && &id->scope () != &c); // Comes from base. data_member* optimistic (context::optimistic (c)); @@ -251,6 +252,20 @@ namespace relational { if (!poly_derived) { + // id (id_image_type) + // + if (auto_id) + { + os << "inline" << endl + << traits << "::id_type" << endl + << traits << "::" << endl + << "id (const id_image_type& i)" + << "{" + << "return object_traits_impl< " << class_fq_name (*base) << + ", id_" << db << " >::id (i);" + << "}"; + } + // id (image_type) // if (options.generate_query ()) -- cgit v1.1