[odb-users] Composing object view attribute

Roman Shametko shametko.roman at gmail.com
Wed Apr 15 08:43:00 EDT 2015


Thanks a lot, Boris!

I'm using 2.3 now, and I didn't know about object loading view.


On 04/15/2015 03:27 PM, Boris Kolpackov wrote:
> Hi Roman,
>
> Roman Shametko <shametko.roman at gmail.com> writes:
>
>> So I can call A->m_parent->getPath() which gonna result in
>> "/home/username/Documents/". This is the path I want to get
>> in view. But I don't really understand how can I achieve this.
> Neither do I. What would be an SQL SELECT-list expression that
> would return such a path? If you can come up with one, then you
> can embed it into the view. Obviously, an SQL database cannot
> just "call" A->m_parent->getPath() ;-).
>
>
>> Basically I'd be happy with following view:
>>
>> #pragma db view /*some other objects*/  object(AdjacencyListItem)
>> class View {
>> public:
>>      ...
>>       std::shared_ptr<AdjacencyListItem> m_parent;
>> };
>>
>> But as far as I understand it's impossible to get one.
> Why not? Since 2.4.0 there is support for object loading
> views (Section 10.2).
>
> Boris



More information about the odb-users mailing list