Re: moving to VelocityGenerator from JavaEOGenerator

From: Mike Schrag (mschra..dimension.com)
Date: Tue Jan 22 2008 - 16:28:51 EST

  • Next message: Mike Schrag: "Re: moving to VelocityGenerator from JavaEOGenerator"

    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&lt;<wo:WOString
    > value="[entity.className]"/>&gt; 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 - 16:30:19 EST