Hello all,
I have the following entity:
public class Request
{
public virtual int Id;
public virtual string Name;
public virtual string AssignedTo;
}
Let's say I want some more information about the AssignedTo field. In terms of the domain, the AssignedTo field is really an Employee. An employee comes from different server/database than the Request object and is immutable. I only need an Employee really for SELECT purposes.
What is the best way to create a mapping for this type of relationship? I have tried a few different things, but it seems to me the only way this will work is to create a new method that retrieves the information via an ad-hoc statement (using a linked server).
Technically, an employee is player in the domain, but the employee system has already been built and deployed to a different server/database. I have tried using a JOIN element, but it only joins on the primary key of the parent object which in this case is the Id. I need for it to join on the AssignedTo field.
I tried mapping an entity (brand new mapping file) for an employee, but it throws an error that the schema has too many prefixes (I put in the servername.category.schema.table).
Should I keep it as a separate method? It seems to be the easiest, but at the same time really redundant since all I need are a few fields from the employee table while at the same time requiring most of the information in the Request object.
**EDIT I am currently using NHibernate 2.0.1.4000. Thanks.
|