ok Entity Modeler's fetch specs have fetchSpec.distinctBindings that
returns a set of EOQualifierBindings which have a name and an
attributePath, which returns either an EORelationshipPath or an
EOAttributePath. You can get the childRelationship (EORelationship)
or childAttribute (EOAttribute) off of this depending on what the
binding is a reference to.
ms
On Jan 22, 2008, at 4:28 PM, Mike Schrag wrote:
> Actually as I'm fixing this in velocity, I think JavaEOGenerator is
> wrong here in its implementation. I believe it should be the case
> that binding.name is the name of the binding key used in the
> qualifier. In EOFetchSpecProxy in JavaEOGen this instead would end
> up returning the name of the attribute or relationship that is
> binding bound to. As long as you bind "company = $company" this
> will work, but if you do "company = $mycompany" I think
> EOFetchSpecProxy would give you the wrong thing. I think this (and
> how velocity eogen will impl this) should hand back some cover
> object whose name is the binding key and whose value is the
> attribute or relationship that is bound.
>
> ms
>
> On Jan 22, 2008, at 2:22 PM, Oswaldo Bueno wrote:
>
>> Hi,
>> I'm moving my eo templates to veogen.
>>
>> I'm unable to find a way to get an array of binds of a
>> fetchspecification.
>>
>> My JavaEOGenerator template was:
>>
>> <wo:WORepetition list="[entity.classFetchSpecifications]"
>> item="[fetchSpecification]">
>> public static NSArray<<wo:WOString
>> value="[entity.className]"/>> objectsFor<wo:WOString
>> value="[fetchSpecification.initialCapitalName]"/
>> >(com.webobjects.eocontrol.EOEditingContext
>> context<wo:WORepetition list="[fetchSpecification.bindings]"
>> item="[binding]">, <wo:WOString
>> value="[binding.valueTypeClassName]"/>
>> <wo:WOString value="[binding.name]"/>Binding</wo:WORepetition>) {
>>
>>
>>
>>
>> My Veogen template:
>>
>> #foreach ($fetchSpecification in $entity.sortedFetchSpecs)
>> public static NSArray<${entity.className}>
>> fs${fetchSpecification.capitalizedName}(
>> com.webobjects.eocontrol.EOEditingContext context#foreach ($binding
>> in $fetchSpecification.bindings),
>> ${binding.valueTypeClassName} ${binding.name}Binding#end) {
>>
>>
>>
>>
>> Is there a solution to this?
>>
>>
>> Thanks,
>> Bueno
>>
>>
>>
>> --
>> -----------------------------------------------------------------------------------------
>> Oswaldo V. C. Bueno - http://bueno.carpintaria.com
>> Carpintaria do Software - http://www.carpintaria.com
>
>
This archive was generated by hypermail 2.0.0 : Tue Jan 22 2008 - 17:23:40 EST