1. You can use a <many-to-one> in your Patient mapping like this:
Code:
<many-to-one name="PatientStatus" column="PatientStatus_ID"/>
The .net type of this property need to be a PatientStatus class.
2. If you are mapping PatientStatus_ID as a plain old <property>, the .net type of your property needs to be an int or long depending on your db column type.
My suggestion if you go with #1 above is to map the <many-to-one> with the fetch="select" attribute
in combination with second-level cache. That way, you are doing one less join and you are not fetching all the PatientStatus objects all the time.
Our application has about 80 of these lookup classes. We found that mapping the PatientStatus_ID column as a true .net enum works way better from a test-driven development perspective. We still have the likes of the PatientStatus classes mapped via NHibernate, but we only fetch it when we need the details from it. Majority of the time, we are doing something like this:
Code:
Patient p = new Patient();
p.PatientStatus = PatientStatus.IdEnum.New;
// where PatientStatus.IdEnum is a nested enum defined inside the PatientStatus class
You situation will be different; but if you don't need the properties of the PatientStatus most of the time, then only mapping its ID to the Patient class is, in my opinion, a better way to go. Hope it helps.