Package org.ofbiz.core.entity
Class EntityWhereString
java.lang.Object
org.ofbiz.core.entity.EntityCondition
org.ofbiz.core.entity.EntityWhereString
- All Implemented Interfaces:
Serializable
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, EntityExprList and EntityFieldMap objects which more cleanly encapsulate where conditions and don't require you to directly write SQL.
- Since:
- 2.0
- Version:
- $Revision: 1.1 $
- Author:
- David E. Jones
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckCondition(ModelEntity modelEntity) Checks this condition against the given entity.intgetParameterCount(ModelEntity modelEntity, SqlEscapeHelper sqlEscapeHelper) Returns the number of SQL parameters that would be generated for this condition.makeWhereString(ModelEntity modelEntity, List<? super EntityConditionParam> entityConditionParams, SqlEscapeHelper sqlEscapeHelper) Creates a string for use in a WHERE clause, based on this condition.toString()
-
Field Details
-
sqlString
-
-
Constructor Details
-
EntityWhereString
protected EntityWhereString() -
EntityWhereString
-
-
Method Details
-
makeWhereString
public String makeWhereString(ModelEntity modelEntity, List<? super EntityConditionParam> entityConditionParams, SqlEscapeHelper sqlEscapeHelper) Description copied from class:EntityConditionCreates a string for use in a WHERE clause, based on this condition.- Specified by:
makeWhereStringin classEntityCondition- Parameters:
modelEntity- the entity being queried for (required)entityConditionParams- a non-null list to which this method will add any required bind values- Returns:
- a non-null string
-
getParameterCount
Description copied from class:EntityConditionReturns the number of SQL parameters that would be generated for this condition.- Overrides:
getParameterCountin classEntityCondition- Parameters:
modelEntity- the entity being queried for (required)- Returns:
- the number of SQL parameters.
-
checkCondition
Description copied from class:EntityConditionChecks this condition against the given entity.- Specified by:
checkConditionin classEntityCondition- Parameters:
modelEntity- the entity being queried for (required)- Throws:
GenericModelException- if the condition is not met
-
toString
-