Hello, people!
I have one class and i map it to different tables (I do it by using entityname), but when i try to get data from one table, then i get it from all mapped tables. Please, tell me how to turn it off without building new SessionFactory! Thanks!
code:
Code:
......
var entName = ThisType.Name + ".TableRecordClass" + number;
var criteria = session.CreateCriteria(entName);
var sections = criteria.Add(Expression.Eq("ParentId", Id)).List<TableRecordClass>();
hbm:
<class entity-name="ObjectType.TableRecordClass1" name="TableRecordClass" table="DirectoriesSection1">
<id name="Id">
<column name="Id" sql-type="bigint" not-null="true" />
<generator class="native"></generator>
</id>
<property name="Name">
<column name="Name" length="50" not-null="true" />
</property>
<property name="Type" />
<property name="ParentId" />
</class>
<class entity-name="ObjectClass.TableRecordClass1" name="TableRecordClass" table="DocumentsSection1">
<id name="Id">
<column name="Id" sql-type="bigint" not-null="true" />
<generator class="native"></generator>
</id>
<property name="Name">
<column name="Name" length="50" not-null="true" />
</property>
<property name="Type" />
<property name="ParentId" />
</class>
<class entity-name="ObjectClass.TableRecordClass2" name="TableRecordClass" table="DocumentsSection2">
<id name="Id">
<column name="Id" sql-type="bigint" not-null="true" />
<generator class="native"></generator>
</id>
<property name="Name">
<column name="Name" length="50" not-null="true" />
</property>
<property name="Type" />
<property name="ParentId" />
</class>