Hi, I've a problem with table per class hierarchy strategy:
I've a base class NodeACL and the derived classes UserACL, GroupACL.
NodeACL has a property called SecurityObject, which is defined into the other ACL's objects. Infact if you have a UserACL the security object is a User : ISecurityObject and if you have a group the object is a Group : ISecurityObject.
This is my mapping file.... I need to have "SecurityObject" property inside the NodeACL mapping and in all its subclasses... Is it possible?
Thanks!
-----------------------------------------------------------------------------
Mapping file :
-----------------------------------------------------------------------------
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Eureka.Keeper.Security.NodeACL, Eureka.Keeper" table="Keeper_Nodes_ACL">
<id name="Id" access="nosetter.pascalcase-underscore" column="IDACL" type="Int32">
<generator class="identity"/>
</id>
<discriminator column="AllowedType" />
<many-to-one name="Node" access="nosetter.pascalcase-underscore" class="Eureka.Keeper.Node, Eureka.Keeper" column="IDNode" />
<property name="ACLType" access="nosetter.pascalcase-underscore" type="Eureka.Keeper.Security.ACLType, Eureka.Keeper" />
<many-to-one name="SecurityObject" access="nosetter.pascalcase-underscore" class="Eureka.Security.ISecurityObject, Eureka.Core" column="IDAllowed" insert="false" update="false">
</many-to-one>
<subclass name="Eureka.Keeper.Security.UserACL, Eureka.Keeper" discriminator-value="0">
<many-to-one name="SecurityObject" access="nosetter.pascalcase-underscore" class="Eureka.Security.User, Eureka.Core" cascade="none" column="IDAllowed">
</many-to-one>
</subclass>
<subclass name="Eureka.Keeper.Security.GroupACL, Eureka.Keeper" discriminator-value="1">
<many-to-one name="SecurityObject" access="nosetter.pascalcase-underscore" class="Eureka.Security.Group, Eureka.Core" cascade="none" column="IDAllowed">
</many-to-one>
</subclass>
</class>
</hibernate-mapping>
-----------------------------------------------------------------------------
|