AW: [odb-users] Index of member of composite value

Marcel Nehring mne at qosmotec.com
Fri Apr 1 09:49:42 EDT 2016


Hi Andreas,

see the ODB manual, section 14.7 "Index Definition Pragmas" (at bottom of page 273):

"It is possible to define an index on a member that is of a composite value type or on some of its nested members."

#pragma db value
struct point
{
int x;
int y;
int z;
};

#pragma db object
class object
{
// An index that includes all of the p1’s nested members.
//
#pragma db index
point p1;
point p2;
// An index that includes only p2.x and p2.y.
//
#pragma db index("p2_xy_i") members(p2.x, p2.y) };

Regards,
Marcel

-----Ursprüngliche Nachricht-----
Von: odb-users-bounces at codesynthesis.com [mailto:odb-users-bounces at codesynthesis.com] Im Auftrag von Andreas Pasternak
Gesendet: Freitag, 1. April 2016 13:22
An: odb-users at codesynthesis.com
Betreff: [odb-users] Index of member of composite value

Hello all,

Is it possible to make a member of a composite value an index like that?

#pragma db value
class Foo {
   #pragma db index
   int x;
}
ODB complains that I am trying to create an index on a non-persistent class.


Thank you!

Andreas




More information about the odb-users mailing list