AW: [odb-users] Index of member of composite value
Andreas Pasternak MT-Robot AG
a.pasternak at mt-robot.com
Fri Apr 1 15:21:07 EDT 2016
Thank you!
I guess I missed this part. The problem is that I have autogenerated
code. So it is going to be hard to implement this syntax. It would be
great if I could specify the index pragma inside the composite value
class, as I described below, because there I know which member should
be indexed, while my code generator doesn't have this information at
the object class level.
Does someone know if this feature is implemented in the next upcoming release?
Best regards,
Andreas
----------------original message-----------------
From: Marcel Nehring [mne at qosmotec.com ]
To: odb-users at codesynthesis.com Date: Fri, 1 Apr 2016 13:49:42 +0000
-------------------------------------------------
> 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
>
>
>
--
MT Robot AG
Riedstrasse 16
CH-4222 Zwingen
Tel. - +41 (0)61 775 20 20
Direkt - +41 (0)61 775 20 26
Mobile - +41 (0)76 489 21 16
Fax - +41 (0)61 775 20 21
Email - [ mailto:a.pasternak at mt-robot.com %20%20 ->
a.pasternak at mt-robot.com ]
Web - www.mt-robot.com
Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte
Informationen enthalten.Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort
den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren
sowie die unbefugte Weitergabe dieser E-Mail sind nicht gestattet.
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipien
More information about the odb-users
mailing list