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:it.bysoftware.ct.service.persistence.RigoDocumentoPK.java

License:Open Source License

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

    sb.append(StringPool.OPEN_CURLY_BRACE);

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

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

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

    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("idAssociato");
    sb.append(StringPool.EQUAL);
    sb.append(idAssociato);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:it.bysoftware.ct.service.persistence.TestataDocumentoPK.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);/* w ww . j  a v  a 2s.c o  m*/
    sb.append(anno);

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

    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("idAssociato");
    sb.append(StringPool.EQUAL);
    sb.append(idAssociato);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:it.dontesta.labs.liferay.lrbo16.servicebuilder.service.persistence.impl.HorsePersistenceImpl.java

License:Open Source License

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

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

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

        Serializable primaryKey = iterator.next();

        Horse horse = fetchByPrimaryKey(primaryKey);

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

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

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

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

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

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

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

    query.append(_SQL_SELECT_HORSE_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 (Horse horse : (List<Horse>) q.list()) {
            map.put(horse.getPrimaryKeyObj(), horse);

            cacheResult(horse);

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

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

    return map;
}

From source file:jorgediazest.missingrefchecker.ref.Reference.java

License:Open Source License

public static String getAttributesWithTypes(Model model, String attributes) {

    String allAttrs = StringPool.BLANK;

    for (String attr : attributes.split(",")) {
        int type = model.getAttributeType(attr);

        if (type == 0) {
            TableInfo tableInfo = model.getTableInfo(attr);

            if (tableInfo != null) {
                type = tableInfo.getAttributeType(attr);
                attr = tableInfo.getName() + "." + attr;
            }//from  w  w w.  ja  v a2 s .  co m
        }

        String typeStr = DatabaseUtil.getJdbcTypeNames().get(type);

        if (Validator.isNotNull(allAttrs)) {
            allAttrs += StringPool.COMMA;
        }

        allAttrs = allAttrs + attr + "(" + typeStr + ")";
    }

    return allAttrs;
}

From source file:jorgediazest.util.output.OutputUtils.java

License:Open Source License

public static String getCSVRow(List<String> rowData) {
    return getCSVRow(rowData, StringPool.COMMA);
}

From source file:monthly.trading.service.persistence.impl.MonthlyTradingPersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, MonthlyTrading> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }/*w  w  w .j  ava 2 s  .com*/

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

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

        Serializable primaryKey = iterator.next();

        MonthlyTrading monthlyTrading = fetchByPrimaryKey(primaryKey);

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

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

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

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

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

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

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

    query.append(_SQL_SELECT_MONTHLYTRADING_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 (MonthlyTrading monthlyTrading : (List<MonthlyTrading>) q.list()) {
            map.put(monthlyTrading.getPrimaryKeyObj(), monthlyTrading);

            cacheResult(monthlyTrading);

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

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

    return map;
}

From source file:net.indaba.lostandfound.service.persistence.impl.ItemPersistenceImpl.java

License:Open Source License

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

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

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

        Serializable primaryKey = iterator.next();

        Item item = fetchByPrimaryKey(primaryKey);

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

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        Item item = (Item) entityCache.getResult(ItemModelImpl.ENTITY_CACHE_ENABLED, ItemImpl.class,
                primaryKey);

        if (item == null) {
            if (uncachedPrimaryKeys == null) {
                uncachedPrimaryKeys = new HashSet<Serializable>();
            }

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

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

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

    query.append(_SQL_SELECT_ITEM_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 (Item item : (List<Item>) q.list()) {
            map.put(item.getPrimaryKeyObj(), item);

            cacheResult(item);

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

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

    return map;
}

From source file:net.indaba.lostandfound.service.persistence.impl.LFImagePersistenceImpl.java

License:Open Source License

@Override
public Map<Serializable, LFImage> fetchByPrimaryKeys(Set<Serializable> primaryKeys) {
    if (primaryKeys.isEmpty()) {
        return Collections.emptyMap();
    }/* w ww. j  a  v a 2  s.com*/

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

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

        Serializable primaryKey = iterator.next();

        LFImage lfImage = fetchByPrimaryKey(primaryKey);

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

        return map;
    }

    Set<Serializable> uncachedPrimaryKeys = null;

    for (Serializable primaryKey : primaryKeys) {
        LFImage lfImage = (LFImage) entityCache.getResult(LFImageModelImpl.ENTITY_CACHE_ENABLED,
                LFImageImpl.class, primaryKey);

        if (lfImage == null) {
            if (uncachedPrimaryKeys == null) {
                uncachedPrimaryKeys = new HashSet<Serializable>();
            }

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

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

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

    query.append(_SQL_SELECT_LFIMAGE_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 (LFImage lfImage : (List<LFImage>) q.list()) {
            map.put(lfImage.getPrimaryKeyObj(), lfImage);

            cacheResult(lfImage);

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

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

    return map;
}

From source file:net.sareweb.mshowcase.service.persistence.CategoryPK.java

License:Open Source License

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

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("categoryId");
    sb.append(StringPool.EQUAL);/*from   ww  w.j ava 2  s  .  c  om*/
    sb.append(categoryId);

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

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:org.fit.portlet.service.service.persistence.InserInsertoresPK.java

License:Open Source License

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

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("id");
    sb.append(StringPool.EQUAL);/*from   www . java 2s.  co  m*/
    sb.append(id);

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

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}