Hello, i am using Hibernate with annotated entities (both with JPA and Hibernate annotations).
I am having a schema with many users, having many groups, having many roles.
The problem i am experiencing is that hibernate makes an additional query for each of users to select his groups, so if i selected 100 users -- i will get 100+M queries, where M is some small constant (1-4 queries), which is slow and inefficent.
I would like to alter this behavior, probably forcing hibernate to use a few JOIN queries instead of lots of additional queries.
I have tried adding @Fetch(FetchMode.JOIN) annotation to my UserEntity.groups and GroupEntity.roles fields, but it changed nothing.
Please, advise me how to solve this problem.
Here are my entities:
UserEntity.javaCode:
@Entity
@Table(name = "users")
public class UserEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
private Integer id;
@Column(nullable = false, unique = true)
private String name;
@Column(nullable = false)
private String passwordHash;
@Column(nullable = false)
private Date joined = new Date();
@Column(nullable = false)
private Boolean active = true;
@Column(nullable = true)
private String email = null;
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinTable(
name = "users_groups_map",
joinColumns = @JoinColumn(name = "userId", nullable = false, updatable = false),
inverseJoinColumns = @JoinColumn(name = "groupId", nullable = false, updatable = false))
@OrderBy("name")
private Set<GroupEntity> groups;
// setters and getters
}
GroupEntity.javaCode:
@Entity
@Table(name = "groups")
public class GroupEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
private Integer id;
@Column(nullable = false, unique = true)
private String name;
@Column(nullable = true)
private String description;
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinTable(
name = "groups_roles_map",
joinColumns = @JoinColumn(name = "groupId", nullable = false, updatable = false),
inverseJoinColumns = @JoinColumn(name = "roleId", nullable = false, updatable = false))
@OrderBy("name")
private Set<RoleEntity> roles = new HashSet<RoleEntity>();
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "groups")
@OrderBy("joined")
private Set<UserEntity> users = new HashSet<UserEntity>();
// setters and getters
}
RoleEntity.javaCode:
@Entity
@Table(name = "roles")
public class RoleEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
private Integer id;
@Column(nullable = false, unique = true)
private String name;
@Column(nullable = true)
private String description;
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "roles")
@OrderBy("name")
private Set<GroupEntity> groups;
// setters and getters
}
And here is my hibernate log upon selecting 100 users:
Code:
Hibernate: select userentity0_.id as id1_4_, userentity0_.active as active2_4_, userentity0_.email as email3_4_, userentity0_.joined as joined4_4_, userentity0_.name as name5_4_, userentity0_.passwordHash as password6_4_ from users userentity0_ order by userentity0_.joined desc limit ? offset ?
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select roles0_.groupId as groupId1_0_1_, roles0_.roleId as roleId2_1_1_, roleentity1_.id as id1_3_0_, roleentity1_.description as descript2_3_0_, roleentity1_.name as name3_3_0_ from groups_roles_map roles0_ inner join roles roleentity1_ on roles0_.roleId=roleentity1_.id where roles0_.groupId=? order by roleentity1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select groups0_.userId as userId1_4_1_, groups0_.groupId as groupId2_5_1_, groupentit1_.id as id1_0_0_, groupentit1_.description as descript2_0_0_, groupentit1_.name as name3_0_0_ from users_groups_map groups0_ inner join groups groupentit1_ on groups0_.groupId=groupentit1_.id where groups0_.userId=? order by groupentit1_.name
Hibernate: select count(userentity0_.id) as col_0_0_ from users userentity0_