You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adam Heath <do...@brainfood.com> on 2009/07/03 19:11:21 UTC

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

jonesde@apache.org 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.

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

Posted by David E Jones <de...@me.com>.
On Jul 3, 2009, at 11:11 AM, Adam Heath wrote:

> jonesde@apache.org 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