Hey,

2010/1/18 OvermindDL1 <[email protected]>:
> I have an entity like this:
>
> class Group;
> typedef dbo::collection< dbo::ptr<Group> > Groups;
> class Group
> {
> public:
>        /* snip */
>        Groups      groups;
>        Groups      isSubGroupOf;
>        /* snip */
>
>        template<class Action>
>        void persist(Action& a)
>        {
>                /* snip */
>                dbo::hasMany(a, groups,       dbo::ManyToMany, 
> "Group_Group_Link");
>                dbo::hasMany(a, isSubGroupOf, dbo::ManyToMany, 
> "Group_Group_Link");
>                /* snip */
>        }
> };
>
> Either instead of setting the id for both sides of the ManyToMany
> relationship as Group_id, should it not do Group_id1 and Group_id2, or

Good point, I hadn't consider many-to-many between the same class.

> perhaps let hasMany take a 5th parameter that lets you name the
> variable this side represents in the ManyToMany table so I could do
> something like this:
>                /* snip */
>                dbo::hasMany(a, groups,       dbo::ManyToMany, 
> "Group_Group_Link",
> "Group_id_parent");
>                dbo::hasMany(a, isSubGroupOf, dbo::ManyToMany, 
> "Group_Group_Link",
> "Group_id_child");
>                /* snip */

Perhaps this is the more elegant solution; we can make the 5th
argument optional.

> And yes, as stated in the other email, my Groups table I still have to
> mapClass as "_Group" since table names are still not quoted, I am
> running from the latest git version as of about 36 hours ago.

You should be running the latest git version of a few seconds ago!
You'll notice the improvement :-)

> And we need a way to redefine an existing table, at the very least to
> add columns to it so I do not have to save out and re-enter my data
> every time I make a change.  Even something like setting a static
> version number to the entity class along with a function that lets me
> describe change from version to version would be perfect, then I can
> say what to remove, what to add, how to reformat something, etc...
> propagating all the way through the changes.

Yes we need that. But we need ideas to keep this simple too.

Regards,
koen

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to