changed user and resource entity to fetch mode select with batch size 20
This commit is contained in:
parent
0561d73ae2
commit
df22c4d613
2 changed files with 10 additions and 4 deletions
|
@ -44,6 +44,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.annotations.BatchSize;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
|
||||
|
@ -109,7 +110,8 @@ public class ResourceEntity {
|
|||
private List<PolicyEntity> policies = new LinkedList<>();
|
||||
|
||||
@OneToMany(cascade = CascadeType.REMOVE, orphanRemoval = true, mappedBy="resource")
|
||||
@Fetch(FetchMode.SUBSELECT)
|
||||
@Fetch(FetchMode.SELECT)
|
||||
@BatchSize(size = 20)
|
||||
private Collection<ResourceAttributeEntity> attributes = new ArrayList<>();
|
||||
|
||||
public String getId() {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.keycloak.models.jpa.entities;
|
||||
|
||||
import org.hibernate.annotations.BatchSize;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.hibernate.annotations.Nationalized;
|
||||
|
@ -96,15 +97,18 @@ public class UserEntity {
|
|||
protected String realmId;
|
||||
|
||||
@OneToMany(cascade = CascadeType.REMOVE, orphanRemoval = true, mappedBy="user")
|
||||
@Fetch(FetchMode.SUBSELECT)
|
||||
@Fetch(FetchMode.SELECT)
|
||||
@BatchSize(size = 20)
|
||||
protected Collection<UserAttributeEntity> attributes = new ArrayList<UserAttributeEntity>();
|
||||
|
||||
@OneToMany(cascade = CascadeType.REMOVE, orphanRemoval = true, mappedBy="user")
|
||||
@Fetch(FetchMode.SUBSELECT)
|
||||
@Fetch(FetchMode.SELECT)
|
||||
@BatchSize(size = 20)
|
||||
protected Collection<UserRequiredActionEntity> requiredActions = new ArrayList<UserRequiredActionEntity>();
|
||||
|
||||
@OneToMany(cascade = CascadeType.REMOVE, orphanRemoval = true, mappedBy="user")
|
||||
@Fetch(FetchMode.SUBSELECT)
|
||||
@Fetch(FetchMode.SELECT)
|
||||
@BatchSize(size = 20)
|
||||
protected Collection<CredentialEntity> credentials = new ArrayList<CredentialEntity>();
|
||||
|
||||
@Column(name="FEDERATION_LINK")
|
||||
|
|
Loading…
Reference in a new issue