tracker issue : CF-3043093

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 85843:When you are manually doing a cfquery with the type of HQL, the cfqueryparam makes your hql case sensitve

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): Zach Stevenson / Zach Stevenson (zach@caxiamgroup.com)

Created: 01/14/2011

Components: ORM Support

Versions: 9.0.1

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 1

Problem:

When you are manually doing a cfquery with the type of HQL, the cfqueryparam makes your hql case sensitve.  For example:  In a previous bug i posted (BUG 85104), I mentioned that when you are extending from a mappedSuperClass that the child doesn't get properly cased properties.  So, We have a  MappedSuperClass Parent A, the entity which is extending the parent class B, and a DAO that is using cfquery with hql.  Class A has all of our base properties for the table.  Class B is the Entity that we are referencing and it has no properties in it.  When we call the DAO to execute the query with a cfqueryparam in the where clause, it makes the query case sensitive and has to match the class b exactly, which it doesn't because it's all lowercase because of the last bug i posted.  If there is no cfqueryparam and you enter your variable like '#arguments.variableName#', it does not treat it case sensitive and works perfectly fine.  
Method:

//  Parent Class _userTypecomponent mappedSuperClass="true" output="false"{property name="userTypeID" fieldtype="id" generator="assigned";property name="type";public function init(){return this;}}/*  THIS WORKS PERFECTLY FINE *///child class without propertiescomponent extends="models.userType._userType" entityName="userType" persistent="true" table="user_type" output="false"{}//query inside the dao<cfquery name="data" dbtype="hql" ormoptions="#local.queryOptions#">FROM       userTypeWHERE      1 = 1<cfif Len(arguments.userTypeID)>AND        userTypeID = "#arguments.userTypeID#"</cfif><cfif Len(arguments.type)>AND        type = "#arguments.type#"</cfif><cfif StructKeyExists(arguments, "orderBy") and Len(arguments.orderBy)>ORDER BY   #arguments.orderBy#</cfif></cfquery>/* This does not work: *///child class without propertiescomponent extends="models.userType._userType" entityName="userType" persistent="true" table="user_type" output="false"{}//query inside the dao<cfquery name="data" dbtype="hql" ormoptions="#local.queryOptions#">FROM       userTypeWHERE      1 = 1<cfif Len(arguments.userTypeID)>AND        userTypeID = <cfqueryparam value="#arguments.userTypeID#" CFSQLType="cf_sql_varchar"/></cfif><cfif Len(arguments.type)>AND        type = <cfqueryparam value="#arguments.type#" CFSQLType="cf_sql_varchar"/></cfif><cfif StructKeyExists(arguments, "orderBy") and Len(arguments.orderBy)>ORDER BY   #arguments.orderBy#</cfif></cfquery>/* BUT this does work *///child class WITH propertiescomponent extends="models.userType._userType" entityName="userType" persistent="true" table="user_type" output="false"{property name="userTypeID" fieldtype="id" generator="assigned";}//query inside the dao<cfquery name="data" dbtype="hql" ormoptions="#local.queryOptions#">FROM       userTypeWHERE      1 = 1<cfif Len(arguments.userTypeID)>AND        userTypeID = <cfqueryparam value="#arguments.userTypeID#" CFSQLType="cf_sql_varchar"/></cfif><cfif Len(arguments.type)>AND        type = <cfqueryparam value="#arguments.type#" CFSQLType="cf_sql_varchar"/></cfif><cfif StructKeyExists(arguments, "orderBy") and Len(arguments.orderBy)>ORDER BY   #arguments.orderBy#</cfif></cfquery>
Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3043093

External Customer Info:
External Company:  
External Customer Name: Zach Stevenson
External Customer Email: 746562334CB8ACAD0A746C1C
External Test Config: 01/14/2011

Attachments:

Comments: