[odb-users] Multi-Database Support - Cannot integrate Multi-Database Support / Bug report for the compiler: odb-2.2.1-i686-windows

Boris Kolpackov boris at codesynthesis.com
Fri May 24 07:39:30 EDT 2013


Hi Benjamin,

Benjamin Schudel <benjamin.schudel at nexirius.com> writes:

> template <typename A>
>   const typename query_columns< ::BaseBO, id_mssql, A >::id_type_
>   query_columns< ::BaseBO, id_mssql, A >::
>   id (query_columns< ::BaseBO, id_common, typename A::common_traits >::id,
>       A::table_name, "[id]", 0, 1);
> error C2039: 'table_name' : is not a member of
> 'odb::access::object_traits_impl<BaseBO,id_mssql>'
> (ODBGenerated\BaseBO-odb-mssql.cxx)

I could reproduce this on my side and it is a bug in the ODB compiler.
I will work on the fix and get back to you. A simple workaround for
now is not to declare your BaseBO class as abstract. You will end up
an extra table in the database, but otherwise this change should be
harmless.


> I guess it has never been initialized correctly?

Hm, this is strange. I tried it on my side, and I see things initialized.
Can you make sure that you do all of the following:

1. You generate User-odb-mssql.cxx.

2. You generate User-odb-mssql.cxx with query support enabled
   (-q/--generate-query).

3. You actually link User-odb-mssql.cxx to your application. Be careful
   if User-odb-mssql.cxx is packaged into a static library -- in this case
   it may be ignored.

If you do all of the above, check User-odb-mssql.cxx. You should see code
like this at the end of the file:

  static const
  access::object_traits_impl< ::User, id_common >::
  function_table_type function_table_User_ =
  {
    &access::object_traits_impl< ::User, id_mssql >::persist,
    &access::object_traits_impl< ::User, id_mssql >::find,
    &access::object_traits_impl< ::User, id_mssql >::find,
    &access::object_traits_impl< ::User, id_mssql >::reload,
    &access::object_traits_impl< ::User, id_mssql >::update,
    &access::object_traits_impl< ::User, id_mssql >::erase,
    &access::object_traits_impl< ::User, id_mssql >::erase,
    &access::object_traits_impl< ::User, id_mssql >::query,
    &access::object_traits_impl< ::User, id_mssql >::erase_query
  };

  static const object_function_table_entry< ::User, id_mssql >
  function_table_entry_User_ (
    &function_table_User_);

Boris



More information about the odb-users mailing list