• 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: How to fetch eo with a specific relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to fetch eo with a specific relationship


  • Subject: Re: How to fetch eo with a specific relationship
  • From: Louis Demers <email@hidden>
  • Date: Thu, 7 Feb 2008 00:37:27 -0500


On 6-Feb-08, at 21:16 , Mike Schrag wrote:

For no reason other than I like its expressiveness, if you use Wonder you can just do this:

EOFetchSpecification fs = new EOFetchSpecification("Product", ERXQ.equals("category", aCategory), null);
... or even better, use the Wonder eogen templates that use ERXKey:

EOFetchSpecification fs = new EOFetchSpecification(Product.ENTITY_NAME, Product.CATEGORY.is(aCategory), null);

... or even better, use the Wonder eogen templates fetch methods w/ ERXKey:




NSArray<Product> products = Product.fetchProducts(editingContext, Product.CATEGORY.is(aCategory), null);


I'm using the eogen templates for velocity you supplied (_Entity,java. and Entity.java) and while ENTITY_NAME is defined (as a string), CATEGORY is not but CATEGORY_KEY is (also as a string). My Product object extends _Product which extends ERXGenericRecord.

I'm running Webobjects 5.4 on Leopard. I used the templates at
http://webobjects.mdimension.com/wolips/EOGenerator/Velocity EOGenerator Templates/Entity.java and
http://webobjects.mdimension.com/wolips/EOGenerator/Velocity EOGenerator Templates/_Entity.java


I was unsure about using _Entity.java/Entity.java instead of the apparently more recent but simpler _Entity14.java/Entity14.java.

The only change to the template was in Entity.java to generate EO that extends ERXGenericRecord instead of EOGenericRecords.


DO I have to patch my templates with some additional patterns to have it generate the missing code ?



ms

thanks.

Louis Demers eng.
www.obzerv.com


_______________________________________________ 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: How to fetch eo with a specific relationship
      • From: Mike Schrag <email@hidden>
References: 
 >How to fetch eo with a specific relationship (From: Louis Demers <email@hidden>)
 >Re: How to fetch eo with a specific relationship (From: "Daniele Corti" <email@hidden>)
 >Re: How to fetch eo with a specific relationship (From: Robert Walker <email@hidden>)
 >Re: How to fetch eo with a specific relationship (From: Louis Demers <email@hidden>)
 >Re: How to fetch eo with a specific relationship (From: Chuck Hill <email@hidden>)
 >Re: How to fetch eo with a specific relationship (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Educate me on generics please...
  • Next by Date: Re: How to fetch eo with a specific relationship
  • Previous by thread: Re: How to fetch eo with a specific relationship
  • Next by thread: Re: How to fetch eo with a specific relationship
  • Index(es):
    • Date
    • Thread