Paul,

You're absolutely right. Koen answered a similar question on our
redmine forum not so long ago.
http://redmine.emweb.be/boards/2/topics/show/298
This extension is on our wishlist.

Best regards,
Wim.

2010/6/17 Paul Harrison <[email protected]>:
>
> Hi,
>
> I was wondering if there are any plans for being able to map class
> hierarchies - or indeed if anyone has already done such a thing with
> Wt::Dbo?
>
> I can see that it is possible to have a pattern like
>
> class Base {
>    int bi;
>
>    template<class Action>
>      void persist(Action& a) {
>          dbo::field(a, bi, "bi"); }
>
> }
> class D1 : public Base {
>      int da;
>
>    template<class Action>
>      void persist(Action& a) {
>          base::persist(a);
>          dbo::field(a, da, "da"); }
>
> }
> class D2 : public Base {
>      int db;
>
>    template<class Action>
>      void persist(Action& a) {
>          base::persist(a);
>          dbo::field(a, db, "db"); }
>
> }
>
> and then
>  session.mapClass<D1>("D1");
>  session.mapClass<D2>("D2");
>
> so that there is one (unrelated) table for each subclass (OK if the
> base class is abstract). However, it would be nice to be able to map
> these classes to 3 related tables where there is a 1-to-1 relation
> between the derived class tables and the base class - I don't think
> that this is achievable with the current facilities, particularly
> without introducing extra members to store the relationships - I think
> that it would be desirable if the foreign key relations in the derived
> classes were automatically managed.
>
> Regards,
>        Paul.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to