[odb-users] Index of member of composite value

Boris Kolpackov boris at codesynthesis.com
Mon Apr 4 09:47:04 EDT 2016

Hi Andreas,

Andreas Pasternak MT-Robot AG <a.pasternak at mt-robot.com> writes:

> 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?

No, there is no such feature. The problem is composite value types
don't have associated tables. They are "instantiated" into the
tables of the objects they are used in, with their column names
often adjusted, etc. While database indexes are always defined on
tables. So to implement something like this we would have to have
something like an "index template" that also gets instantiated into
the table. We will also have to have an "index name template" since
nothing prevents you from using the same composite type twice in the
same object. As you can see, this gets hairy very quickly.

As Marcel suggested, the best way is to add the index pragmas out
of generated classes. You must already be doing this to map objects.


More information about the odb-users mailing list