congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GroupAdapter.getEntity
Code IndexAdd Tabnine to your IDE (free)

How to use
getEntity
method
in
org.keycloak.models.jpa.GroupAdapter

Best Java code snippets using org.keycloak.models.jpa.GroupAdapter.getEntity (Showing top 4 results out of 315)

origin: org.keycloak/keycloak-model-jpa

protected TypedQuery<GroupRoleMappingEntity> getGroupRoleMappingEntityTypedQuery(RoleModel role) {
  TypedQuery<GroupRoleMappingEntity> query = em.createNamedQuery("groupHasRole", GroupRoleMappingEntity.class);
  query.setParameter("group", getEntity());
  query.setParameter("roleId", role.getId());
  return query;
}
origin: org.keycloak/keycloak-model-jpa

@Override
public Set<RoleModel> getRoleMappings() {
  // we query ids only as the role might be cached and following the @ManyToOne will result in a load
  // even if we're getting just the id.
  TypedQuery<String> query = em.createNamedQuery("groupRoleMappingIds", String.class);
  query.setParameter("group", getEntity());
  List<String> ids = query.getResultList();
  Set<RoleModel> roles = new HashSet<RoleModel>();
  for (String roleId : ids) {
    RoleModel roleById = realm.getRoleById(roleId);
    if (roleById == null) continue;
    roles.add(roleById);
  }
  return roles;
}
origin: org.keycloak/keycloak-model-jpa

public static GroupEntity toEntity(GroupModel model, EntityManager em) {
  if (model instanceof GroupAdapter) {
    return ((GroupAdapter)model).getEntity();
  }
  return em.getReference(GroupEntity.class, model.getId());
}
origin: org.keycloak/keycloak-model-jpa

@Override
public void grantRole(RoleModel role) {
  if (hasRole(role)) return;
  GroupRoleMappingEntity entity = new GroupRoleMappingEntity();
  entity.setGroup(getEntity());
  entity.setRoleId(role.getId());
  em.persist(entity);
  em.flush();
  em.detach(entity);
}
org.keycloak.models.jpaGroupAdaptergetEntity

Popular methods of GroupAdapter

  • <init>
  • getGroupRoleMappingEntityTypedQuery
  • getId
  • getRoleMappings
  • hasRole
  • persistAttributeValue
  • removeAttribute
  • toEntity

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JLabel (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Table (org.hibernate.mapping)
    A relational table
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now