It's not a database that I necessarily have access to (actually maybe
it isn't a database at all, basically an object loaded by a black box
provider implementing an interface)

I'll try to explain better with some back of the napkin code, so
excuse me if there are errors in it :)

  <class name="Comment">
    <id name="Id">
    </id>
    <many-to-one name="Author" type="ProviderUser" />
  ...
  </class>

Imagine now we have a provider interface:

public interface IUserProvider
{
        User GetUser(string userId);
        User[] GetUsers(string[] userIds);
}

Then ProviderUser is something like:

public class ProviderUser : NHibernate.UserTypes.IUserType
{
...
public object NullSafeGet(System.Data.IDataReader rs, string[] names,
object owner)
        {
            string uid =
NHibernate.NHibernateUtil.String.NullSafeGet(rs, names[0]) as string;
            IUserProvider userProvider =
BadStaticClass.GetUserProvider();

            return userProvider.GetUser(uid);
        }
...
}

My question is how can I implement something like this while allowing
batch loading of the Authors.  Sorry for my poor description before.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to