From d33b95fff7f790d669c5798fdab913d38fc4ae79 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 5 Jan 2011 13:50:34 +0200 Subject: Factor out id initialization and container loading into separate functions --- odb/mysql/header.cxx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'odb/mysql/header.cxx') diff --git a/odb/mysql/header.cxx b/odb/mysql/header.cxx index cd9eeec..12f3e4d 100644 --- a/odb/mysql/header.cxx +++ b/odb/mysql/header.cxx @@ -857,6 +857,12 @@ namespace mysql << "init (object_type&, const image_type&, database&);" << endl; + // init (id_image, id) + // + os << "static void" << endl + << "init (id_image_type&, const id_type&);" + << endl; + // persist () // os << "static void" << endl @@ -897,17 +903,28 @@ namespace mysql // Implementation details. // - os << "public:" << endl - << "static bool" << endl - << "find_ (mysql::object_statements&, const id_type&);" + os << "public:" << endl; + + // Load the object image. + // + os << "static bool" << endl + << "find_ (mysql::object_statements< object_type >&, const id_type&);" + << endl; + + // Load the rest of the object (containers, etc). Expects the id + // image in the object statements to be initialized to the object + // id. + // + os << "static void" << endl + << "load_ (mysql::object_statements< object_type >&, object_type&);" << endl; if (options.generate_query ()) os << "static void" << endl << "query_ (database&," << endl << "const query_type&," << endl - << "mysql::object_statements&," << endl - << "details::shared_ptr&);" + << "mysql::object_statements< object_type >&," << endl + << "details::shared_ptr< mysql::select_statement >&);" << endl; os << "};"; -- cgit v1.1