error : java.lang.String cannot be cast to coldfusion.cfc.CFCBeanProxy anyone know about this ?
Posted
by faheem
on Stack Overflow
See other posts from Stack Overflow
or by faheem
Published on 2010-04-30T17:57:04Z
Indexed on
2010/04/30
18:17 UTC
Read the original article
Hit count: 447
Hi does anyone know about this error I get when I try to insert a foreign key value in my entry entity using cf9 Hibernate ?
java.lang.ClassCastException: java.lang.String cannot be cast to coldfusion.cfc.CFCBeanProxy
Root cause :org.hibernate.HibernateException: java.lang.ClassCastException: java.lang.String cannot be cast to coldfusion.cfc.CFCBeanProxy
Below is the code for my entity object and then for my user object..
Is there anything wrong with this ?
entry.cfc
/**
* Entries Object
*/
component output="false" persistent="true"{
property name="entry_id" fieldType="id" generator="uuid";
property name="entryBody" ormType="text";
property name="title" notnull="true" type="string";
property name="time" fieldtype="timestamp";
property name="isCompleted" ormType="boolean" dbdefault="0" default="false";
property name="userID" fieldtype="many-to-one" fkcolumn="userID" cfc="user";
Entry function init() output=false{
return this;
}
}
user.cfc
/**
* Users Object
*/
component output="false" persistent="true"{
property name="userID" fieldType="id" generator="uuid";
property name="firstName" notnull="true" type="string";
property name="lastName" notnull="true" type="string";
property name="password" notnull="true" type="string";
property name="userType" notnull="true" type="string";
//property name="entry" fieldtype="one-to-many" type="array" fkcolumn="userID" cfc="entry";
User function init() output=false{
return this;
}
}
© Stack Overflow or respective owner