我正在使用Coldfusion ORM(Hibernate),并将cfc映射到数据库表。一切正常,但现在我想将数组属性添加到数据库中不存在的CFC。我需要向属性添加哪些属性才能导致ORM错误?
component extends="_base" persistent="true" accessors="true" table="foo" {
// Primary Key
property name='fooID' fieldtype='id' column='fooID' generator='native';
// Properties
property name='fooTypeID' ormtype='int';
property name='fooName' ormtype='string';
// Properties that are not database columns or relationships
property name='fooArray' type='array' <= causes error
public array function $toString() output="false" {
var toStringMessage = 'foo = [
fooID: ' & getFooID() & '
fooTypeID: ' & getfooTypeID() & '
fooName: ' & getfooName() & '
fooArray: ' & getfooArray() & '
]';
return toStringMessage;
}
}
答案 0 :(得分:6)
关闭该物业的持久性:
property name='fooArray' type='array' persistent='false';