[odb-users] Query std::vector or object relationships

Jan Kuentzer kuentzer at googlemail.com
Mon Jul 4 11:29:14 EDT 2011


Hi,

I generated with ODB for our project successfully the sql code and was able
to serialize objects into the database. It is really fast and the data is
stored in the db schema.
After that I tried to search for objects using the query capabilities from
ODB. For simple datatypes like std::string or int this works pretty fine,
but for container like std::vector<std::string> attributes I always get the
compile error "is not a member of odb::query<..."

As an example the class Xref has a std::string attribute called "db" and for
this the following works fine:
odb::query< Xref> q (odb::query< Xref>::db == "some_string");

But the class UtilityClass has a std::vector<std::string> attribute called
"comment" and for this the following gives the mentioned compile error:
odb::query<UtitliyClass> q (odb::query<UtitlityClass>::comment ==
"some_string");
The same is true for a Class with std::vector<Xref*> attribute. This also
doesn't compile when using the attribute names as shown in employee-employer
example.

Do I use the odb::query in a wrong way?

Thanks in advance for your help !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UtilityClass.h
Type: text/x-chdr
Size: 739 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20110704/847c1844/UtilityClass.h


More information about the odb-users mailing list