【发布时间】:2010-04-30 17:57:04
【问题描述】:
有人知道我在尝试使用 ColdFusion 9 Hibernate 集成在我的条目实体中插入外键值时遇到的这个错误吗?
java.lang.ClassCastException:java.lang.String 无法转换为 Coldfusion.cfc.CFCBeanProxy
根本原因:org.hibernate.HibernateException: java.lang.ClassCastException: java.lang.String 无法转换为 Coldfusion.cfc.CFCBeanProxy
下面是我的实体对象的代码,然后是我的用户对象的代码..
这有什么问题吗?
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;
}
}
【问题讨论】:
-
output="false" 对于脚本样式的组件来说并不是真正需要的。
标签: hibernate orm coldfusion coldfusion-9