Re: [Jaxor-devel] Re: Associating Lists
Brought to you by:
mrettig
|
From: Michael R. <mik...@ya...> - 2004-08-08 02:34:38
|
Carl,
That was quick. I added a couple new failing tests. If
we have a list that is already set on on entity,
then we need to set the foreign fields for each entity
that is added to the list. Also, if we change the
value of the key on the source entity, then we need to
update the keys on the list entities.
I checked in the tests. Do you want to take a stab at
them?
--- Carl Fyffe <car...@gm...> wrote:
> I have checked the code in for OneToMany. There are
> two issues that I
> am unhappy about. First, you must have an
> <entity-ref> in the .jaxor
> of the foreign object (see email.jaxor) and for
> setXXXXXList(list) to
> work. It throws a SQLValidationException and tells
> you that the
> column was expected to have a value, but for some
> reason this doesn't
> "smell" good.
>
> Second, I have added this method to
> ForeignFieldLazyLoader:
>
> private boolean isForeignKey(EntityRow
> targetEntity) {
> for(Iterator iterator =
> targetEntity.getForeignFields().iterator();
> iterator.hasNext();) {
> ForeignFieldLazyLoader loader =
> (ForeignFieldLazyLoader)
> iterator.next();
> if (loader.getResolver().isUnique())
> return true;
> }
> return false;
> }
>
> The idea is to find out if the targetEntity is
> related to the
> sourceEntity. I have tested against ManyToManyTest
> and against my new
> OneToManyTest and all lights are green. This method
> works, and I
> don't know why. I was expecting to need to check
> directly against the
> sourceEntity as well, but apparently I don't.
>
> The concern is that it will set the list for the
> wrong foreign
> field... I am sorry if this seems un-smart, but it
> seems like magic
> to me :-) Can anyone come up with a test that will
> cause this method
> to return true, thus allowing a save to the wrong
> table?
>
> On Sat, 7 Aug 2004 14:49:55 -0700 (PDT), Michael
> Rettig
> <mik...@ya...> wrote:
> > Carl,
> >
> > You should have write permissions. I added you to
> the
> > project as a developer.
> >
> >
>
http://sourceforge.net/project/memberlist.php?group_id=59712
> >
> > Did you checkout the project using ssh?
> >
> > http://sourceforge.net/cvs/?group_id=59712
> >
> > Mike
> >
> > --- Carl Fyffe <car...@gm...> wrote:
> >
> > > Since a Many to Many is really just a One to
> Many on
> > > two sides, I
> > > thought I would solve the One to Many problem
> first.
> > > That is done. I
> > > would like to check the code in, but I don't
> have
> > > write permission in
> > > the repository.
> > >
> > > On Sat, 7 Aug 2004 10:08:14 -0700 (PDT), Michael
> > > Rettig
> > > <mik...@ya...> wrote:
> > > >
> > > > --- Carl Fyffe <car...@gm...> wrote:
> > > >
> > > > > Another idea that I have had would be to
> start
> > > from
> > > > > the linking
> > > > > object. Put something into the
> group_members
> > > that
> > > > > would allow the
> > > > > user to create the links.
> > > > >
> > > > > GroupMemberFinder.newInstances(group,
> userList);
> > > > > // or
> > > > > GroupMemberFinder.newInstances(user,
> groupList);
> > > > >
> > > > > First would take a list of users and link
> them
> > > to
> > > > > the group, the
> > > > > second would take a list of groups and link
> to
> > > the
> > > > > user. What would
> > > > > the xml look like to make this happen....
> > > > >
> > > > > <list-ref table="user_table" type="fk">
> > > > > <key source="user_name"/>
> > > > > </list-ref>
> > > > >
> > > > > <list-ref table="groups" type="fk">
> > > > > <key source="group_name"/>
> > > > > </list-ref>
> > > > >
> > > > > I like the look of this and will try to get
> it
> > > > > working this weekend.
> > > >
> > > > Yes, I like the look of this too. I'm eager
> to
> > > see it
> > > > in action.
> > > >
> > > > Regards,
> > > >
> > > >
> > > > Mike
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > New and Improved Yahoo! Mail - 100MB free
> storage!
> > > > http://promotions.yahoo.com/new_mail
> > > >
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Take Yahoo! Mail with you! Get it on your mobile
> phone.
> > http://mobile.yahoo.com/maildemo
> >
>
>
>
-------------------------------------------------------
> This SF.Net email is sponsored by OSTG. Have you
> noticed the changes on
> Linux.com, ITManagersJournal and NewsForge in the
> past few weeks? Now,
> one more big change to announce. We are now OSTG-
> Open Source Technology
> Group. Come see the changes on the new OSTG site.
> www.ostg.com
> _______________________________________________
> Jaxor-devel mailing list
> Jax...@li...
>
https://lists.sourceforge.net/lists/listinfo/jaxor-devel
>
__________________________________
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now.
http://messenger.yahoo.com
|