当我尝试使用 ColdFusion 9 Hibernate 集成在我的条目实体中插入外键值时,有人知道我得到的这个错误吗?
java.lang.ClassCastException:java.lang.String 无法转换为 Coldfusion.cfc.CFCBeanProxy
根本原因:org.hibernate.HibernateException:java.lang.ClassCastException:java.lang.String 无法转换为coldfusion.cfc.CFCBeanProxy
下面是我的实体对象的代码,然后是我的用户对象的代码。
这有什么问题吗?
入口.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;
}
}
用户.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;
}
}