• 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: Raw SQL with bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Raw SQL with bindings


  • Subject: Re: Raw SQL with bindings
  • From: Chris Pastore <email@hidden>
  • Date: Thu, 10 Nov 2011 14:08:13 -0800
  • Acceptlanguage: en-US
  • Thread-topic: Raw SQL with bindings

As a follow up to this question, what is the best approach for calling 'addBindVariableDictionary()' when you have two entities in your query?

Not sure if this is the best way to to do it, but I was able to get this to work by adding a second entity.

EOEntity e1 = EOUtilities.entityForClass(ctx, Entity1.class);
EOEntity e2 = EOUtilities.entityForClass(ctx, Entity2.class);
..
EOSQLExpression exp = factory.createExpression(e1)  <-- Here I just chose one entity to create the _expression_ and it seemed to work
..
exp.addBindVariableDictionary(exp.bindVariableDictionaryForAttribute(e1.attributeNamed(e1.E1_ID_KEY), value);
exp.addBindVariableDictionary(exp.bindVariableDictionaryForAttribute(e2.attributeNamed(e2.E2_ID_KEY), value);

Thoughts? Confusion? Chaos?

Thanks,

Chris Pastore
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
  • Prev by Date: Re: [SOLVED]: Is JDBCAdaptor generating the wrong SQL for fixed length character columns?
  • Next by Date: Re: Boolean bindings in API files
  • Previous by thread: Re: Raw SQL with bindings
  • Next by thread: modern look and page tabs
  • Index(es):
    • Date
    • Thread