Aaron
Aaron

Reputation: 1052

ORM Mapping Error

I have a set of ORM objects that work on my CF9 & 10 local workstation and one of my CF9 servers (we'll say INT & EXT ) but not the other. Everything appears to be setup correctly but then when I call prc.app.save(), an instance of the app entity I get the following message.

Detail:  Either the mapping for this component is missing or the application must be restarted to generate the mapping.
Message  Mapping for component dot.path.to.model.app not found.

They system admin says that the two servers A & B are are setup identically.

Here is the property that is causing the problem in the model/app.cfc file.

component entityName="app" extends="coldbox.system.orm.hibernate.ActiveEntity" table="real_table_name"  schema="real_schema" persistent="true"{     
....
property name="applicants" 
    fieldtype="one-to-many" 
    column="app_id" 
    cfc="applicant" 
    fkcolumn="app_id" type="array" 
    singularname="applicant" 
    lazy="false" 
    cascade="save-update" 
    orderby="app_num";

The model/applicant.cfc looks like this

component entityName="applicant" extends="coldbox.system.orm.hibernate.ActiveEntity" table="real_table_name"  schema="real_schema" persistent="true"{   
property name="applicant_id" 
    fieldtype="id" 
    generator="sequence" 
    sequence="real_sequence";
property name="app_id" ormtype="integer";
property name="app_num" ormtype="integer";

I believe that my ORM settings are setup correctly.

<cfset this.ormSettings = {
        cflocation              = "model",
        logSQL                  = true,
        flushAtRequestEnd       = false,
        autoManageSession       = false,
        eventHandling           = true,
        eventHandler            = "coldbox.system.orm.hibernate.WBEventHandler"
        }>

This is within the ColdBox 3.5 framework.

I'm looking for any suggestions to help me trace down this error.

Thanks.

Upvotes: 1

Views: 654

Answers (1)

Aaron
Aaron

Reputation: 1052

Ok. Now I feel dumb. The orderby="app_num" attribute some how got set in the app_id property. It is a column in the applicant entity not the app entity.

Upvotes: 1

Related Questions