Example usage for com.liferay.portal.kernel.util StringPool COMMA

List of usage examples for com.liferay.portal.kernel.util StringPool COMMA

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util StringPool COMMA.

Prototype

String COMMA

To view the source code for com.liferay.portal.kernel.util StringPool COMMA.

Click Source Link

Usage

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularResourcePermissionPersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularResourcePermission> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }/*from w w w. ja v  a  2 s.  c o  m*/

    Map<Serializable, AngularResourcePermission> map = new HashMap<Serializable, AngularResourcePermission>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularResourcePermission angularResourcePermission = fetchByPrimaryKey(primaryKey);

        if (angularResourcePermission != null) {
            map.put(primaryKey, angularResourcePermission);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(
                AngularResourcePermissionModelImpl.ENTITY_CACHE_ENABLED, AngularResourcePermissionImpl.class,
                primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularResourcePermission) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARRESOURCEPERMISSION_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularResourcePermission angularResourcePermission : (List<AngularResourcePermission>) q.list()) {
            map.put(angularResourcePermission.getPrimaryKeyObj(), angularResourcePermission);

            cacheResult(angularResourcePermission);

            uncachedPrimaryKeys.remove(angularResourcePermission.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularResourcePermissionModelImpl.ENTITY_CACHE_ENABLED,
                    AngularResourcePermissionImpl.class, primaryKey, nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularRolePersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularRole> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }//from  w ww . j  a v a  2  s  .  c  o m

    Map<Serializable, AngularRole> map = new HashMap<Serializable, AngularRole>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularRole angularRole = fetchByPrimaryKey(primaryKey);

        if (angularRole != null) {
            map.put(primaryKey, angularRole);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(AngularRoleModelImpl.ENTITY_CACHE_ENABLED,
                AngularRoleImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularRole) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARROLE_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularRole angularRole : (List<AngularRole>) q.list()) {
            map.put(angularRole.getPrimaryKeyObj(), angularRole);

            cacheResult(angularRole);

            uncachedPrimaryKeys.remove(angularRole.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularRoleModelImpl.ENTITY_CACHE_ENABLED, AngularRoleImpl.class, primaryKey,
                    nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularSitePersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularSite> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }// ww w.j  ava  2s. c o  m

    Map<Serializable, AngularSite> map = new HashMap<Serializable, AngularSite>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularSite angularSite = fetchByPrimaryKey(primaryKey);

        if (angularSite != null) {
            map.put(primaryKey, angularSite);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(AngularSiteModelImpl.ENTITY_CACHE_ENABLED,
                AngularSiteImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularSite) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARSITE_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularSite angularSite : (List<AngularSite>) q.list()) {
            map.put(angularSite.getPrimaryKeyObj(), angularSite);

            cacheResult(angularSite);

            uncachedPrimaryKeys.remove(angularSite.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularSiteModelImpl.ENTITY_CACHE_ENABLED, AngularSiteImpl.class, primaryKey,
                    nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularTeamPersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularTeam> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }//from   ww w . j  a v  a 2s . c  o m

    Map<Serializable, AngularTeam> map = new HashMap<Serializable, AngularTeam>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularTeam angularTeam = fetchByPrimaryKey(primaryKey);

        if (angularTeam != null) {
            map.put(primaryKey, angularTeam);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(AngularTeamModelImpl.ENTITY_CACHE_ENABLED,
                AngularTeamImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularTeam) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARTEAM_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularTeam angularTeam : (List<AngularTeam>) q.list()) {
            map.put(angularTeam.getPrimaryKeyObj(), angularTeam);

            cacheResult(angularTeam);

            uncachedPrimaryKeys.remove(angularTeam.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularTeamModelImpl.ENTITY_CACHE_ENABLED, AngularTeamImpl.class, primaryKey,
                    nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularUserGroupPersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularUserGroup> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }//  w ww . j a  va 2 s  .c  o  m

    Map<Serializable, AngularUserGroup> map = new HashMap<Serializable, AngularUserGroup>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularUserGroup angularUserGroup = fetchByPrimaryKey(primaryKey);

        if (angularUserGroup != null) {
            map.put(primaryKey, angularUserGroup);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(AngularUserGroupModelImpl.ENTITY_CACHE_ENABLED,
                AngularUserGroupImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularUserGroup) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARUSERGROUP_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularUserGroup angularUserGroup : (List<AngularUserGroup>) q.list()) {
            map.put(angularUserGroup.getPrimaryKeyObj(), angularUserGroup);

            cacheResult(angularUserGroup);

            uncachedPrimaryKeys.remove(angularUserGroup.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularUserGroupModelImpl.ENTITY_CACHE_ENABLED, AngularUserGroupImpl.class,
                    primaryKey, nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularUserPersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularUser> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }/*from ww  w.ja v  a2s.c o  m*/

    Map<Serializable, AngularUser> map = new HashMap<Serializable, AngularUser>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularUser angularUser = fetchByPrimaryKey(primaryKey);

        if (angularUser != null) {
            map.put(primaryKey, angularUser);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(AngularUserModelImpl.ENTITY_CACHE_ENABLED,
                AngularUserImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularUser) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARUSER_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularUser angularUser : (List<AngularUser>) q.list()) {
            map.put(angularUser.getPrimaryKeyObj(), angularUser);

            cacheResult(angularUser);

            uncachedPrimaryKeys.remove(angularUser.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularUserModelImpl.ENTITY_CACHE_ENABLED, AngularUserImpl.class, primaryKey,
                    nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularVirtualHostPersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularVirtualHost> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }//from   w  ww  .j a  va  2  s  . c o m

    Map<Serializable, AngularVirtualHost> map = new HashMap<Serializable, AngularVirtualHost>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularVirtualHost angularVirtualHost = fetchByPrimaryKey(primaryKey);

        if (angularVirtualHost != null) {
            map.put(primaryKey, angularVirtualHost);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(AngularVirtualHostModelImpl.ENTITY_CACHE_ENABLED,
                AngularVirtualHostImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularVirtualHost) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARVIRTUALHOST_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularVirtualHost angularVirtualHost : (List<AngularVirtualHost>) q.list()) {
            map.put(angularVirtualHost.getPrimaryKeyObj(), angularVirtualHost);

            cacheResult(angularVirtualHost);

            uncachedPrimaryKeys.remove(angularVirtualHost.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularVirtualHostModelImpl.ENTITY_CACHE_ENABLED,
                    AngularVirtualHostImpl.class, primaryKey, nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:eu.gerhards.liferay.services.angular.service.persistence.impl.AngularVirtualInstancePersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, AngularVirtualInstance> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }/* w ww. ja  va  2s  .  c  o  m*/

    Map<Serializable, AngularVirtualInstance> map = new HashMap<Serializable, AngularVirtualInstance>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        AngularVirtualInstance angularVirtualInstance = fetchByPrimaryKey(primaryKey);

        if (angularVirtualInstance != null) {
            map.put(primaryKey, angularVirtualInstance);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(AngularVirtualInstanceModelImpl.ENTITY_CACHE_ENABLED,
                AngularVirtualInstanceImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (AngularVirtualInstance) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_ANGULARVIRTUALINSTANCE_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (AngularVirtualInstance angularVirtualInstance : (List<AngularVirtualInstance>) q.list()) {
            map.put(angularVirtualInstance.getPrimaryKeyObj(), angularVirtualInstance);

            cacheResult(angularVirtualInstance);

            uncachedPrimaryKeys.remove(angularVirtualInstance.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(AngularVirtualInstanceModelImpl.ENTITY_CACHE_ENABLED,
                    AngularVirtualInstanceImpl.class, primaryKey, nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:fi.jguru.yubikey.otp.login.service.service.persistence.impl.YubikeyOTPKeyEntryPersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, YubikeyOTPKeyEntry> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }//  w w w.  ja va2  s  . c  o m

    Map<Serializable, YubikeyOTPKeyEntry> map = new HashMap<Serializable, YubikeyOTPKeyEntry>();

    if (primaryKeys.size() == 1) {
        Iterator<Serializable> iterator = primaryKeys.iterator();

        Serializable primaryKey = iterator.next();

        YubikeyOTPKeyEntry yubikeyOTPKeyEntry = fetchByPrimaryKey(primaryKey);

        if (yubikeyOTPKeyEntry != null) {
            map.put(primaryKey, yubikeyOTPKeyEntry);
        }

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Serializable serializable = entityCache.getResult(YubikeyOTPKeyEntryModelImpl.ENTITY_CACHE_ENABLED,
                YubikeyOTPKeyEntryImpl.class, primaryKey);

        if (serializable != nullModel) {
            if (serializable == null) {
                if (uncachedPrimaryKeys == null) {
                    uncachedPrimaryKeys = new HashSet<Serializable>();
                }

                uncachedPrimaryKeys.add(primaryKey);
            } else {
                map.put(primaryKey, (YubikeyOTPKeyEntry) serializable);
            }
        }
    }

    if (uncachedPrimaryKeys == null) {
        return map;
    }

    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) + 1);

    query.append(_SQL_SELECT_YUBIKEYOTPKEYENTRY_WHERE_PKS_IN);

    for (Serializable primaryKey : uncachedPrimaryKeys) {
        query.append(String.valueOf(primaryKey));

        query.append(StringPool.COMMA);
    }

    query.setIndex(query.index() - 1);

    query.append(StringPool.CLOSE_PARENTHESIS);

    String sql = query.toString();

    Session session = null;

    try {
        session = openSession();

        Query q = session.createQuery(sql);

        for (YubikeyOTPKeyEntry yubikeyOTPKeyEntry : (List<YubikeyOTPKeyEntry>) q.list()) {
            map.put(yubikeyOTPKeyEntry.getPrimaryKeyObj(), yubikeyOTPKeyEntry);

            cacheResult(yubikeyOTPKeyEntry);

            uncachedPrimaryKeys.remove(yubikeyOTPKeyEntry.getPrimaryKeyObj());
        }

        for (Serializable primaryKey : uncachedPrimaryKeys) {
            entityCache.putResult(YubikeyOTPKeyEntryModelImpl.ENTITY_CACHE_ENABLED,
                    YubikeyOTPKeyEntryImpl.class, primaryKey, nullModel);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    return map;
}

From source file:it.bysoftware.ct.service.persistence.ProgressivoPK.java

License:Open Source License

@Override
public String toString() {
    StringBundler sb = new StringBundler(20);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("anno");
    sb.append(StringPool.EQUAL);//from   w  w  w .j a  v  a  2s . c  o  m
    sb.append(anno);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("idAssociato");
    sb.append(StringPool.EQUAL);
    sb.append(idAssociato);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("tipoDocumento");
    sb.append(StringPool.EQUAL);
    sb.append(tipoDocumento);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("numeroProgressivo");
    sb.append(StringPool.EQUAL);
    sb.append(numeroProgressivo);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}