tracker issue : CF-3037892

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

Bug 75994:[JFERNANDES] Unable to Execute HQL Queries with related entities

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): João Fernandes / João Fernandes (Joao Fernandes)

Created: 03/16/2009

Components: ORM Support

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Major / Unknown

Locale/System: English / Platforms All

Vote Count: 0

Problem:

[JFERNANDES] Unable to Execute HQL Queries with related entities.






Method:

Use this 2 cfcs

entidade.cfc

<cfcomponent persistent="true" table="entidade" entityname="entidade" >

		<cfproperty name="id" column="id" fieldtype="id" datatype="int" length="10"  />
		<cfproperty name="nome" column="nome" datatype="string" 
	        
		<cfproperty
			name="habilitacao" default="0" fieldtype="many-to-one" 
			cfc="habilitacao" 
			fkcolumn="habilitacao_id" 
			mappedby="id" lazy="true" fetch="select" >


</cfcomponent>

habilitacao.cfc

<cfcomponent persistent="true" table="habilitacao" entityname="habilitacao" > 
	<cfproperty name="id" column="id" fieldtype="id" datatype="integer" length="10"  />
	<cfproperty name="habilitacao_nome" column="habilitacao_nome"  length="100"  />

</cfcomponent>

Add some entitade and some habilitacao and relate them.
Then try to execute 

<cfset query = "from entidade as e where e.habilitacao.id = :id">
<cfset result = ormExecuteQuery(query,{id= the_habilitacao_id })>


Result:

The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

Null Pointers are another name for undefined values.

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

Watson Bug ID:	3037892

External Customer Info:
External Company:  
External Customer Name: João Fernandes
External Customer Email: 4E9A42C244586146992015D5
External Test Config: 03/16/2009

Attachments:

Comments: