2
나는이처럼 보이는 개체가 있습니다. "클래스 'MyEntity'에서 '{UserRole.Id을}'속성에 대한 세터를 찾을 수 없습니다"나는 예외를 throw이 실행 경우NHibernate에 AliasToBean와 협회는
ICriteria c = Db.CreateCriteria<MyEntity>("m")
.CreateAlias("Role", "r")
.SetProjection(Projections.ProjectionList()
.Add(
Projections.SqlProjection(@"Name = case TypeId
when 2 then (select Name from tblOne where Id = EntityId)
when 4 then (select Name from tblTwo where Id = EntityId)
when 3 then (select Name from tblThree where Id = EntityId)
end", new string[] { "Name" }, new NHibernate.Type.IType[] { NHibernateUtil.String }))
.Add(Projections.Property("m.Id"), "Id")
.Add(Projections.Property("r.Id"), "UserRole.Id")
.Add(Projections.Property("r.Desc"), "UserRole.Desc")
.Add(Projections.Property("r.Permission"), "UserRole.Permission")
)
.SetResultTransformer(Transformers.AliasToBean<EntityPermission>());
:이 같은 맞춤 기준을 사용하여이 클래스를 채우려 .
제 질문은 aliastobean 지원 연결이 아니며, 그렇다면 올바른 구문은 무엇입니까?