[odb-users] is it possible to use same relationship table for 2
class data members ?
lidia at lemur-soft.com
Wed Dec 11 01:44:05 EST 2013
We definitely will try to use custom mapping odb functionality.
If you could recommend some known payment free solution for map
that works well as std::map and has directs "values" function ( get vector
of values without iterating ), it will be great.
Thanks a lot for quick response and great library.
On Wed, Dec 11, 2013 at 7:14 AM, Boris Kolpackov <boris at codesynthesis.com>wrote:
> Hi Lidia,
> Lidia Kalinovsky <lidia at lemur-soft.com> writes:
> > #pragma db table("A_bs")
> > std::unordered_map<unsigned long, std::shared_ptr<B> ,
> std::hash<unsigned long>> m_bsMap;
> > std::vector<std::shared_ptr<B> > m_bs;
> > ( i see solution with defining one member as transient and using db
> > callback functions to update/load it ).
> Yes, this is probably the most straightforward way.
> If you have many objects with such containers (or containers of
> this template), then it may be better to create your own container
> wrapper that maintains the two underlying containers. You can then
> add a custom mapping for such a container for ODB. Let me know if
> you are interested in this approach and I can provide more details.
Software integration and outsourcing services,
Lemur-Soft, Giv'at Nili
Phone : (+972) 545748325
Fax : (+972) 775345383
Email : lidia at lemur-soft.com
More information about the odb-users