私は3つのクラスの次の関係を持っています:
@Entity
public class User{
@OnetoMany
List<Attribute> attributes = new ArrayList<Attribute>();
}
@Entity
public class Attribute{
@ManyToOne
AttributeType attributeType;
}
@Entity
public class AttributeType{
@Column
String type;
}
1 人のユーザーは、m 型の n 属性を持つことができます。
List<AttributeType>
特定のユーザー属性のすべての属性タイプを返す HQL クエリを作成する必要があります。
たとえば、ユーザーは、タイプ t の属性 a、タイプ t の属性 b、およびタイプ t1 の属性 c を持っています。List<AttributeType>
t と t1 を含むものを返す必要があります。
助けてください。このクエリで迷子になりました。