ドメインクラスの場所があります
public abstract class BaseEntity<T> where T: struct
{
public virtual T Id { get; set; }
public virtual bool Equals(BaseEntity<T> other)
}
public class Location : BaseEntity<Int32>
{
public User User {get;set;}
}
public class User : BaseEntity<Int32>
{
public string Name {get;set;
}
public OtherInfo Otherinfo {get;set;};
}
public class OtherInfo
{
public string preference {get;set;};
}
var criteria = session.CreateCriteria(typeof(Location), "alias");
criteria.CreateCriteria("User", "user", JoinType.InnerJoin);
criteria.CreateCriteria("user.Otherinfo", "userInfo",JoinType.InnerJoin);
criteria.Add(Restrictions.Eq("user.Id", 100));
criteria.SetProjection(Projections.Alias(Projections.Id(), "Id"), Projections.Alias(Projections.Property("user.Name"), "Name"), Projections.Alias(Projections.Property("userInfo.preference "), "pref"));
上記の基準を実行すると、userInfo.preferenceでエラーが発生します。{NHibernate.QueryException: プロパティを解決できませんでした: Otherinfo of: Location.User ここで何が間違っていますか。複数のネストされたオブジェクトが原因ですか