• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Little help with a qualifier
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Little help with a qualifier


  • Subject: Re: Little help with a qualifier
  • From: Gustavo Pizano <email@hidden>
  • Date: Tue, 14 Jul 2009 15:12:51 +0200

yep... one question that qual I shold apply it to a fetchWGs(qual) ?
I didn't get when you say that applied to an NSArray.

G.


On Tue, Jul 14, 2009 at 2:45 PM, David Avendasora <email@hidden> wrote:
I think I may have messed that one up. If it doesn't work, try this:

EOQualifier qual = WG.TSXWG.dot(TSxWG.TRANSLATIONSET.dot(TranslationSet.TOUSER_KEY)).contains(((Session)session()).authenticatedUser());

Dave

On Jul 14, 2009, at 8:35 AM, Gustavo Pizano wrote:

WO thanks Dave, I will give it a try right now

G.


On Tue, Jul 14, 2009 at 2:31 PM, David Avendasora <email@hidden> wrote:
Gustavo, 

This uses Wonder's ERXKey syntax which I like the best:

EOQualifier qual = WG.TSXWG.dot(TSxWG.TRANSLATIONSET.dot(TranslationSet.TOUSER)).contains(((Session)session()).authenticatedUser());

That should give you a qualifier that when applied to an NSArray of WG objects will filter it down to only the WGs that are associated with the authenticatedUser().

Dave

On Jul 14, 2009, at 7:04 AM, Gustavo Pizano wrote:

Yep ((Session)session()).authenticatedUser is returning a USER.

I know that when I try to qualify a User given a name I will gt a good qualifier..

now as Chuck said I need all  TRANSLATIONSET for that given user. The relationship between TRANSLATIONSET and USER is called toUser, so Im using the 


 EOQualifier tsQual = new ERXExistsQualifier(ERXQ.
equals(USER.NAME_KEY,((Session)session()).authenticatedUser().name()), TRANSLATIONSET.TO_USER_KEY);

to get that.

now if I potition myseld to get all the WG that contains the TRANSLATIONSET with a specific USER I must use tsQual,  so I tought I could use it from _WG but the relationship between WG and TRANSLATIONSET is a many-to-many having a join table WGxTS, and this table has no name, that;s hy I was thinking that Im in the wrong place.  no?

G.
 


On Tue, Jul 14, 2009 at 12:53 PM, Paul Hoadley <email@hidden> wrote:
Hi Gustavo,


On 14/07/2009, at 5:14 PM, Gustavo Pizano wrote:

Ok this is what I did. but is not working, I have an error in the generated sql or somehting.. becuase it says

java.lang.IllegalStateException: sqlStringForKeyValueQualifier: attempt to generate SQL for er.extensions.qualifiers.ERXKeyValueQualifier (name = 'Gustavo') failed because attribute identified by key 'name' was not reachable from from entity 'WGxTS'

I guess is becaus Im trying to search in the wrong place..

It's not an error in the generated SQL, it's an error in your qualifiers.  To be honest, I can't follow your model, but EOF is telling you the problem: you've tried to qualify an entity on a key that doesn't exist in that entity.  Specifically, 'WGxTS' has no key called 'name'.


As an aside, earlier you wrote:

but so far what I have from the user is the name... so I will need to get the userID something like  toUser.NAME.eq(name).

Yet here:


       EOQualifier tsQual = new ERXExistsQualifier(ERXQ.equals(USER.NAME_KEY,((Session)session()).authenticatedUser().name()), TRANSLATIONSET.TO_USER_KEY);

Don't you have the User?  What's Session.authenticatedUser() returning if it's not a User?


--
Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/



_______________________________________________
Do not post admin requests to the list. They will be ignored.

This email sent to email@hidden




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Little help with a qualifier
      • From: David Avendasora <email@hidden>
References: 
 >Little help with a qualifier (From: Gustavo Pizano <email@hidden>)
 >Re: Little help with a qualifier (From: Chuck Hill <email@hidden>)
 >Re: Little help with a qualifier (From: Gustavo Pizano <email@hidden>)
 >Re: Little help with a qualifier (From: Gustavo Pizano <email@hidden>)
 >Re: Little help with a qualifier (From: Paul Hoadley <email@hidden>)
 >Re: Little help with a qualifier (From: Gustavo Pizano <email@hidden>)
 >Re: Little help with a qualifier (From: David Avendasora <email@hidden>)
 >Re: Little help with a qualifier (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Re: Little help with a qualifier
  • Next by Date: Re: passing an object to a new window
  • Previous by thread: Re: Little help with a qualifier
  • Next by thread: Re: Little help with a qualifier
  • Index(es):
    • Date
    • Thread