Skip to main content
Participant
November 7, 2011
Question

ORM EntitySave() Error

  • November 7, 2011
  • 2 replies
  • 660 views

Hi All

For the life of me I can't seem to escape from this error when using EntitySave():

[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'UserType'.

Normal cfqueries work okay, so I know my cfuser is fine.  I know it's picking up the correct schema because if I change the table name I get an an error saying it is undefined in this schema.

Heres how I'm doing the EntitySave():



userType = EntityNew("userType");



userType.setuserTypeTag('test');


userType.setuserTypeName('test');


userType.setdateCreated(Now());


userType.setdateModified(Now());


userType.setmodifiedBy('2');





EntitySave(userType);

Here is the UserType.cfc

component persistent="true" table="UserType" schema="security" output="false"

{

          /* relationships */

 

          property

                    name      = "User"

                    type      = "array"

                    fieldtype = "one-to-many"

                    cfc       = "User"

          ;

 

          /* properties */

 

          property name="userTypeId"   column="userTypeId"   type="numeric" ormtype="int" fieldtype="id" generator="increment";

 

          property name="userTypeTag"  column="userTypeTag"  type="string"  ormtype="string";

 

          property name="userTypeName" column="userTypeName" type="string"  ormtype="string";

 

          property name="dateCreated"  column="dateCreated"  type="date"    ormtype="timestamp";

 

          property name="dateModified" column="dateModified" type="date"    ormtype="timestamp";

 

          property name="modifiedBy"   column="modifiedBy"   type="numeric" ormtype="int";

 

}

Thanks,

Tim

This topic has been closed for replies.

2 replies

Participant
November 7, 2011

Afraid I already tried this, no joy.

Inspiring
November 7, 2011

I dunno if it should/will make a difference, but try calling your object instance something other than the actual entity name.

--

Adam