summaryrefslogtreecommitdiff
path: root/odb/mysql/header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-22 12:12:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-22 12:12:57 +0200
commit4a50c5a7e9976587569276c768f85ad481694e70 (patch)
treeee55b69055c0a2ae8c6006a954ef2fadf441aaad /odb/mysql/header.cxx
parent7d82192a5d9e87b14625ba3aff2413e09da827be (diff)
Support for session and const objects in generated code
Diffstat (limited to 'odb/mysql/header.cxx')
-rw-r--r--odb/mysql/header.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/odb/mysql/header.cxx b/odb/mysql/header.cxx
index bedf2c9..1dc080a 100644
--- a/odb/mysql/header.cxx
+++ b/odb/mysql/header.cxx
@@ -787,6 +787,11 @@ namespace mysql
<< "id (const object_type&);"
<< endl;
+ if (options.generate_query ())
+ os << "static id_type" << endl
+ << "id (const image_type&);"
+ << endl;
+
// grow ()
//
os << "static void" << endl
@@ -850,7 +855,8 @@ namespace mysql
// query ()
//
if (options.generate_query ())
- os << "static result<object_type>" << endl
+ os << "template<typename T>" << endl
+ << "static result<T>" << endl
<< "query (database&, const query_type&);"
<< endl;
@@ -858,7 +864,16 @@ namespace mysql
//
os << "private:" << endl
<< "static bool" << endl
- << "find (mysql::object_statements<object_type>&, const id_type&);";
+ << "find_ (mysql::object_statements<object_type>&, const id_type&);"
+ << endl;
+
+ if (options.generate_query ())
+ os << "static void" << endl
+ << "query_ (database&," << endl
+ << "const query_type&," << endl
+ << "mysql::object_statements<object_type>&," << endl
+ << "details::shared_ptr<mysql::select_statement>&);"
+ << endl;
os << "};";
}