Re: svn commit: r790791 - in /ofbiz/trunk/framework/entity/src/org/ofbiz/entity: datasource/GenericDAO.java finder/ByAndFinder.java model/ModelEntity.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r790791 - in /ofbiz/trunk/framework/entity/src/org/ofbiz/entity: datasource/GenericDAO.java finder/ByAndFinder.java model/ModelEntity.java

Adam Heath-2
[hidden email] wrote:

> Author: jonesde
> Date: Fri Jul  3 05:14:00 2009
> New Revision: 790791
>
> URL: http://svn.apache.org/viewvc?rev=790791&view=rev
> Log:
> Fixed bug reported by Hans and Adrian that broke the ByAndFinder class where string because method that overrides one on ListFinder wasn't doing that any more because the ListFinder method signature had changed; also did a few little cleanups related to this
> ==============================================================================
> --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ByAndFinder.java (original)
> +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ByAndFinder.java Fri Jul  3 05:14:00 2009
> @@ -47,12 +46,12 @@
>          this.fieldMap = EntityFinderUtil.makeFieldMap(element);
>      }
>  

@Override

> -    protected EntityCondition getWhereEntityCondition(Map<String, Object> context, ModelEntity modelEntity, GenericDelegator delegator) {
> +    public EntityCondition getWhereEntityCondition(Map<String, Object> context, ModelEntity modelEntity, ModelFieldTypeReader modelFieldTypeReader) {
>          // create the by and map
>          Map<String, Object> entityContext = FastMap.newInstance();
>          EntityFinderUtil.expandFieldMapToContext(this.fieldMap, context, entityContext);
>          // then convert the types...
> -        modelEntity.convertFieldMapInPlace(entityContext, delegator);
> +        modelEntity.convertFieldMapInPlace(entityContext, modelFieldTypeReader);
>          return EntityCondition.makeCondition(entityContext);
>      }
>  }

The above annotation should have been added originally; it would have
caught this error, as the signature in the parent class changed, so
that would mean this class wasn't overriding something from it's parent.
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r790791 - in /ofbiz/trunk/framework/entity/src/org/ofbiz/entity: datasource/GenericDAO.java finder/ByAndFinder.java model/ModelEntity.java

David E. Jones-2

On Jul 3, 2009, at 11:11 AM, Adam Heath wrote:

> [hidden email] wrote:
>> Author: jonesde
>> Date: Fri Jul  3 05:14:00 2009
>> New Revision: 790791
>>
>> URL: http://svn.apache.org/viewvc?rev=790791&view=rev
>> Log:
>> Fixed bug reported by Hans and Adrian that broke the ByAndFinder  
>> class where string because method that overrides one on ListFinder  
>> wasn't doing that any more because the ListFinder method signature  
>> had changed; also did a few little cleanups related to this
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/
>> ByAndFinder.java (original)
>> +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/
>> ByAndFinder.java Fri Jul  3 05:14:00 2009
>> @@ -47,12 +46,12 @@
>>         this.fieldMap = EntityFinderUtil.makeFieldMap(element);
>>     }
>>
>
> @Override
>> -    protected EntityCondition getWhereEntityCondition(Map<String,  
>> Object> context, ModelEntity modelEntity, GenericDelegator  
>> delegator) {
>> +    public EntityCondition getWhereEntityCondition(Map<String,  
>> Object> context, ModelEntity modelEntity, ModelFieldTypeReader  
>> modelFieldTypeReader) {
>>         // create the by and map
>>         Map<String, Object> entityContext = FastMap.newInstance();
>>         EntityFinderUtil.expandFieldMapToContext(this.fieldMap,  
>> context, entityContext);
>>         // then convert the types...
>> -        modelEntity.convertFieldMapInPlace(entityContext,  
>> delegator);
>> +        modelEntity.convertFieldMapInPlace(entityContext,  
>> modelFieldTypeReader);
>>         return EntityCondition.makeCondition(entityContext);
>>     }
>> }
>
> The above annotation should have been added originally; it would have
> caught this error, as the signature in the parent class changed, so
> that would mean this class wasn't overriding something from it's  
> parent.

Thanks Adam. I've added those to help with this in rev 791054.

-David