[odb-users] possible regression in odb 2.5 beta with composite values

Sebastian Groth sebastian.groth at enervision.de
Wed May 11 08:46:10 EDT 2022


We discovered the following issue in odb 2.5: When composite values are used in views, wrong column names are being generated for select statements.

Using example from the documentation (removed undescores as we do not append them to members):




#pragma db value
class Name
{
  ...

  std::string first;
  std::string last;
};

#pragma db object
class Person
{
  ...

  #pragma db id auto
  unsigned long id;

  Name name;
};


#pragma db view table("Person")

class ViewPerson

{

    ...

     #pragma db column("name")

     Name name;

};



This will generate a table with the columns: id, name_first, name_last



odb 2.4 generates a select statement for the view with column names name_first and name_last
odb 2.5 generates a select statement for the view with column names namefirst and namelast



The missing underscores cause database exception, because the columns do not exist.





Mit freundlichen Grüßen



Sebastian Groth



--------------------------------------------


sebastian.groth at enervision.de


enervision GmbH

Lothringer Str. 53, D-52070 Aachen

Tel +49-241-51568-16

Fax +49-241-51568-29

Amtsgericht Aachen, HRB 7577

Geschäftsführer: Christian Möllering


More information about the odb-users mailing list