Each New Model Addition Throws Entity Name [Whatever] is ambigous

Hello,

This is my first post here and I am new to Coldbox but have coded in ColdFusion since version 4. I have been working to get my first Coldbox 6 application stood up and have only been working with Coldbox for a few months (COVID time well spent). I am using cborm with the below settings in my application.cfc:

this.mappings[ “/coldbox” ] = COLDBOX_APP_ROOT_PATH & “coldbox”;
this.mappings[ “/myApp” ] = COLDBOX_APP_ROOT_PATH;
this.mappings[ “/cborm” ] = COLDBOX_APP_ROOT_PATH & “modules/cborm”;

// ORM Settings
this.ormEnabled = true;
this.datasource = “persorm”;
this.ormSettings = {
cfclocation = [“models”],
dbcreate = “update”,
logSQL = true,
flushAtRequestEnd = false,
autoManageSession = false,
eventHandling = true,
eventHandler = “cborm.models.EventHandler”
};

My models reside in models/orm and models/orm/option

Models/orm has the supperclass Base.cfc
Models/orm/option has a Base.cfc which extends the models/orm supperclass
All other models extend the Base.cfc in their respective folders

Each time I add a new Model I get Entity Name [Whatever] is ambigous and it states the cfc in question is used twice but there is only one cfc file with said name.

The create orm-crud command does not work because I am extending the model and it cannot find the base component.

The tables all get created in the database as expected with all extended properties.

Is there something I am missing in the process of adding new models?

I am running on macOS Catalina with the following:

  • CommandBox Version: 5.1.1+00191 *
  • CFML Engine: Lucee *
  • CFML Version: 5.3.6.61 stable (Gelert) *
  • Java Version: 11.0.6 (AdoptOpenJDK) *
  • Java Path: /usr/local/bin/jre/bin/java *
  • JLine Terminal org.jline.terminal.impl.PosixSysTerminal *
  • Runwar Version 4.1.2 (/Users/jamesbrockway/.CommandBox/lib/runwar-4.1.2.jar)

Thanks,
James

Welcome to the scene. You might consider joining the coldbox and/or cfml slack channels too.

https://boxteam.herokuapp.com/

https://cfml-slack.herokuapp.com/

Are you saying there are two base.cfc files? The error you’re reporting seems to be coming from Hibernate, so this isn’t really related to ColdBox or CommandBox. Including the full stack trace may help, but you’ll need to search for a hibernate solution to this.

Or consider using Quick instead… https://quick.ortusbooks.com/why-quick

Thanks for the replies. I found a duplicate model I had overlooked with the same entity name and removed it, so my issue is resolved.

Brad,

I did go down the hibernate path to realize that should be the issue as the error stated, and then I kicked myself when I found the duplicate!

I will have to look into Quick as I keep running across it in my searches.

Thanks!