Re: How to fetch eo with a specific relationship
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