Ok..
So I am new to Hibernate(actually NHibernate)...Let me get that out real quick.
Anyway-
Using Hibernatel to do some dev with an Employee->Manager class structure..
Looks like this->
class Employee
{
blah
Employee myManager (so Manager is of type Employee)
blah
}
In the DB there is an Employee table, with EmployeeID as the PK
There is a ManagerID that points back to EmployeeID to get the manager.
Now here is the issue...ManagerID can be null, or have an ID that has not been mapped into the DB yet...so to not be able to go snag the manger is cool...but I cannot seem to figure out the correct HBM syntax to tell hibernate that its ok not to be able to go get the Manager type. Right now Hibernate trys to go walk the db hooking the Employess up with their Managers...but its gonna fail...and I cannot get the query to return.
Here is my HBM
<class name="BaseTPMP.valueobjects.Employee, BaseTPMP" table="refEmployee" >
<id name="EmployeeID" column="EmployeeID" unsaved-value="0" >
<generator class="assigned" />
</id>
<property name="FirstName" column= "FirstName"/>
<property name="LastName" column= "LastName"/>
<many-to-one name="Manager" class="BaseTPMP.valueobjects.Employee, BaseTPMP" column="ManagerID" />
Can I do what I am trying to do with Hibernate?
Help?
Matthew
_________________ Matthew Drooker-Work
|