Hi guys,
I’m attempting to use CB’s ORMService to populate and save a form post. The ORMService is injected into my handler and my handler function looks like this:
var myUser = populateModel( ORMService.new(“myUser”) );
//save the user to the group
ORMService.save(‘myUser’);
The MyUser entity looks like this:
component persistent=“true” table=“myUser” accessors=“true”{
property name=“id” fieldtype=“id” generator=“native”;
property name=“groupid” column=“fk_groupid”;
property name=“userid” column=“fk_userid”;
property name=“active”;
property name=“datecreated” ormtype=“timestamp” type=“string”;
property name=“dateremoved” ormtype=“timestamp” type=“string”;
public void function preInsert(){
variables.active = 1;
variables.datecreated = now();
}
}
When I execute the handler I receive the following error:
Application Execution ExceptionError Type: Application : [N/A]
**Error Messages:**coldfusion.orm.hibernate.HibernatePersistenceManager$InvalidEntityException: Object passed is not a valid entity.
Any ideas?
Thanks,
Nolan