0
많은 열거 값을 통해 가입 할 수 있습니다. NHibernate에 기준은 내가 <code>User</code>라는 하나의 클래스와 <code>UserRole</code> 열거 값이 클래스의 컬렉션을했습니다
public class User {
...
public ICollection<UserRole> UserRoles { get; private set; }
...
}
[Flags]
public enum UserRole {
Beginner = 1,
Advanced = 2,
Expert = 4,
Admin = 8
}
User
UserRole
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
<class name="User, SampleDll" table="tblUser">
...
<bag name="UserRoles" table="tblUserRole" cascade="all-delete-orphan" fetch="join">
<key column="UserId"/>
<element column="RoleId" type="UserRole, SampleDll" />
</bag>
...
</class>
</hibernate-mapping>
지금 내가있는 (사용 queryOver 또는 분리 기준 중 하나를 같은 기준을 실현하는 것이 가능
select u.* from tblUser u
left join tblUserRole ur on ur.UserId = u.UserId
where ur.RoleId = @USER_ROLE
같은 sematics이있는 기준을 만들려면) UserRole
열거 형에 대한 별도의 매핑 파일없이?
미리 감사드립니다.
Mrks는