org.ofbiz.entity.condition
Class EntityWhereString

java.lang.Object
  extended by org.ofbiz.entity.condition.EntityConditionBase
      extended by org.ofbiz.entity.condition.EntityCondition
          extended by org.ofbiz.entity.condition.EntityWhereString
All Implemented Interfaces:
java.io.Serializable

public class EntityWhereString
extends EntityCondition

Encapsulates SQL expressions used for where clause snippets. NOTE: This is UNSAFE and BREAKS the idea behind the Entity Engine where you avoid directly specifying SQL. So, KEEP IT MINIMAL and preferrably replace it when the feature you are getting at is implemented in a more automatic way for you.

By minimal I mean use this in conjunction with other EntityConditions like the EntityExpr, EntityConditionList and EntityFieldMap objects which more cleanly encapsulate where conditions and don't require you to directly write SQL.

See Also:
Serialized Form

Field Summary
protected static  entityWhereStringFactory
           
protected  java.lang.String sqlString
           
 
Fields inherited from class org.ofbiz.entity.condition.EntityConditionBase
_emptyMap, emptyAliases, emptyList
 
Constructor Summary
protected EntityWhereString()
           
  EntityWhereString(java.lang.String sqlString)
          Deprecated. Use EntityCondition.makeConditionWhere() instead
 
Method Summary
 void checkCondition(ModelEntity modelEntity)
           
 void encryptConditionFields(ModelEntity modelEntity, GenericDelegator delegator)
           
 boolean entityMatches(GenericEntity entity)
           
 boolean equals(java.lang.Object obj)
           
 EntityCondition freeze()
           
 java.lang.String getWhereString()
           
 int hashCode()
           
 void init(java.lang.String sqlString)
           
 java.lang.String makeWhereString(ModelEntity modelEntity, java.util.List<EntityConditionParam> entityConditionParams, DatasourceInfo datasourceInfo)
           
 boolean mapMatches(GenericDelegator delegator, java.util.Map<java.lang.String,? extends java.lang.Object> map)
           
 void reset()
           
 void visit(EntityConditionVisitor visitor)
           
 
Methods inherited from class org.ofbiz.entity.condition.EntityCondition
accept, eval, eval, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeCondition, makeConditionDate, makeConditionMap, makeConditionWhere, toString
 
Methods inherited from class org.ofbiz.entity.condition.EntityConditionBase
addValue, castBoolean, equals, getColName, getColName, getColName, getField, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

entityWhereStringFactory

protected static final  entityWhereStringFactory

sqlString

protected java.lang.String sqlString
Constructor Detail

EntityWhereString

protected EntityWhereString()

EntityWhereString

public EntityWhereString(java.lang.String sqlString)
Deprecated. Use EntityCondition.makeConditionWhere() instead

Method Detail

init

public void init(java.lang.String sqlString)

reset

public void reset()

makeWhereString

public java.lang.String makeWhereString(ModelEntity modelEntity,
                                        java.util.List<EntityConditionParam> entityConditionParams,
                                        DatasourceInfo datasourceInfo)
Specified by:
makeWhereString in class EntityCondition

checkCondition

public void checkCondition(ModelEntity modelEntity)
                    throws GenericModelException
Specified by:
checkCondition in class EntityCondition
Throws:
GenericModelException

entityMatches

public boolean entityMatches(GenericEntity entity)
Overrides:
entityMatches in class EntityCondition

mapMatches

public boolean mapMatches(GenericDelegator delegator,
                          java.util.Map<java.lang.String,? extends java.lang.Object> map)
Specified by:
mapMatches in class EntityCondition

getWhereString

public java.lang.String getWhereString()

freeze

public EntityCondition freeze()
Specified by:
freeze in class EntityCondition

encryptConditionFields

public void encryptConditionFields(ModelEntity modelEntity,
                                   GenericDelegator delegator)
Specified by:
encryptConditionFields in class EntityCondition

visit

public void visit(EntityConditionVisitor visitor)
Overrides:
visit in class EntityCondition

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class EntityConditionBase

hashCode

public int hashCode()
Overrides:
hashCode in class EntityConditionBase