I have two components, a base Entity
component:
<cfcomponent persistent="true">
<cfproperty name="Id" fieldtype="id" generator="native">
</cfcomponent>
And a Client
component that extends it:
<cfcomponent persistent="true" extends="Entity">
<cfproperty name="FirstName">
<cfproperty name="LastName">
</cfcomponent>
However, when I try to create an instance of Client
, I get an error that says that they're being mapped as two different tables. I know Hibernate has the ability to ignore a base class, but how would I do it with ColdFusion's tags, or do I have to fall back to HBM mappings for this feature?
Addendum: Removing the persistent="true"
from Entity
doesn't work either, Client
will act as if it doesn't have an Id
property if I do so.
In your base "Entity" class try removing persistent="true" and adding mappedSuperClass="true".
<cfcomponent mappedSuperClass="true">
<cfproperty name="Id" fieldtype="id" generator="native">
</cfcomponent>
You need to have applied the 9.0.1 update to ColdFusion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With