Skip to content

Instantly share code, notes, and snippets.

@mjhagen
Last active August 29, 2015 14:25
Show Gist options
  • Save mjhagen/18502eb2916b8041cf1e to your computer and use it in GitHub Desktop.
Save mjhagen/18502eb2916b8041cf1e to your computer and use it in GitHub Desktop.
Bug in ORM inheritance mapping
component extends="base" persistent="true" table="animal"
{
property fieldType="column" name="isAlive" type="boolean" default=true;
}
component
{
this.name = "ormPlayground";
this.datasource = "mingo";
this.ormEnabled = true;
this.ormSettings.dbcreate = "dropcreate";
function onRequestStart()
{
ormreload();
}
}
component mappedSuperClass="true"
{
property fieldType="id" name="id" generator="increment";
property fieldType="column" name="name";
}
component extends="animal" persistent="true" table="animal"
{
property fieldType="column" name="furColor" default="brown";
}
<cfset fido = entityNew( "dog" ) />
<cfset fido.setName( "Fido" ) />
<cfdump var="#fido#" />
@mjhagen
Copy link
Author

mjhagen commented Jul 22, 2015

Sometimes this works, but most of the time it results in this error: Repeated column in mapping for entity: dog column: name (should be mapped with insert="false" update="false")

CF11 on Windows, but have seen the same thing going back to CF9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment