hi all!
I just want to know if by using a many-to-one relation, i could have the parent element. To explain my question, i have a Class Group and a Class Customer which mapping files are :
Groupe:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="ArchivecoFramework" assembly="ArchivecoFramework">
<class name="Groupe" table="V_GROUPE">
<id name="NomGroupe">
<column name="GROUPE"/>
<generator class="assigned"/>
</id>
<set name="Clients" inverse="true" lazy="true">
<key column="GROUPE"/>
<one-to-many class="Client"/>
</set>
</class>
</hibernate-mapping>
Client :
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="ArchivecoFramework" assembly="ArchivecoFramework">
<class name="Client" table="FCLIENTREF">
<id name="CodeClient">
<column name="CODECLIENT" not-null="true"/>
<generator class="assigned"/>
</id>
<property name="NomClient" column="NOMCLIENT" not-null="true"/>
<property name="Actif" column="INACTIF" type="boolean"/>
<property name="IpAutorisees" column="IPAUTORISEES" type="String"/>
<property name="Ssl" column="SSL" type="boolean"/>
<!--<property name="Groupe" column="GROUPE" not-null="true"/>-->
<many-to-one name="GroupeParent" class="Groupe">
<column name="GROUPE" not-null="true"/>
</many-to-one>
<bag name="Services" lazy="true">
<key column="CODECLIENT"/>
<one-to-many class="Service"/>
</bag>
</class>
</hibernate-mapping>
If i try to edit a HQL Query like
"IQuery query = session.CreateQuery("from Client");
comboBox1.DataSource = query.List();"
i just have an error message like "can't create a proxy instance".
Details :
"Creating a proxy instance failed
System.TypeLoadException: Access denied : 'ArchivecoFramework.Groupe'."
Can someone help me to resolve it ???
thx.