I have two DTO which are implemented using user defined types using ICompositeuser type
1. PatientDTO
2. FallDTO
Structure of these objects is like my patientDTO has collection of FallDTO in one-to-many relationship
My PatientDTO looks like following
private
mycomplexdatatype _Patientenid = new mycomplexdatatype();
public virtual mycomplexdatatype Patientenid
{
get
{
return _Patientenid;
}
set
{
_Patientenid = value;
}
}
where mycomplexdatatype is derived from ICompositeUserType which Nhibernate exposes to implement user defined data type.
My PatientDTO has a object collection of type FallDTO which is defined using Iset .
private ISet<FallDTO> _TBLFALLANWESEND = new HashedSet<FallDTO>();
public virtual ISet<FallDTO> TBLFALLANWESEND
{
get
{
return _TBLFALLANWESEND;
}
set
{
_TBLFALLANWESEND = value;
}
}
Now my problem is when I load my patientDTO its gets loaded with Null collection where I have set LazyLoad to false . My current problem is that there is
no exception happening at this point its just that the collection is not loaded. My patient.hbm.xml files looks like this.
<class name="NHibernateConsole.PatientDTO, NHibernateConsole" table="TBLPATIENT" >
<id name="Patientenid" column="PATIENTENID" type="
itb.Foundation.mycomplexdatatype , itb.Foundation" unsaved-value="null">
<generator class="assigned">
</generator>
</id>
<set name="TBLFALLANWESEND" cascade="none" inverse="false" lazy="false" >
<key>
<column name="PATIENTENID"/>
</key>
<one-to-many class="NHibernateConsole.FallDTO, NHibernateConsole"/>
</set>
Now if I change my ID column data type from user defined type that is using composite usertype to primitive data type the collection is loaded irrespective of whether my FallDTO has primitive or user defined type.Could anyone help me understand about what exactly is happening here. We have even tried the same with NHibernate version 2.0 but no success. Is it not possible to use user defined types and have complex DTOs All help is appreciated.
Hibernate version: 1.2
Mapping documents: as shown above
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html