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

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

Introduction

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

Prototype

String BLANK

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

Click Source Link

Usage

From source file:at.graz.hmmc.liferay.portlet.puch.model.impl.PuchMuseumsObjektCacheModel.java

License:Open Source License

@Override
public PuchMuseumsObjekt toEntityModel() {
    PuchMuseumsObjektImpl puchMuseumsObjektImpl = new PuchMuseumsObjektImpl();

    puchMuseumsObjektImpl.setPuchmuseumsobjectId(puchmuseumsobjectId);
    puchMuseumsObjektImpl.setCreaterUserId(createrUserId);

    if (createDate == Long.MIN_VALUE) {
        puchMuseumsObjektImpl.setCreateDate(null);
    } else {//from  w ww .  j a  v  a2  s.c  om
        puchMuseumsObjektImpl.setCreateDate(new Date(createDate));
    }

    puchMuseumsObjektImpl.setModifiedUserId(modifiedUserId);

    if (modifiedDate == Long.MIN_VALUE) {
        puchMuseumsObjektImpl.setModifiedDate(null);
    } else {
        puchMuseumsObjektImpl.setModifiedDate(new Date(modifiedDate));
    }

    if (objekttyp == null) {
        puchMuseumsObjektImpl.setObjekttyp(StringPool.BLANK);
    } else {
        puchMuseumsObjektImpl.setObjekttyp(objekttyp);
    }

    puchMuseumsObjektImpl.setObjektid(objektid);
    puchMuseumsObjektImpl.setFolder(folder);

    puchMuseumsObjektImpl.resetOriginalValues();

    return puchMuseumsObjektImpl;
}

From source file:at.graz.hmmc.liferay.portlet.puch.model.impl.PuchMuseumsObjektCacheModel.java

License:Open Source License

@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(puchmuseumsobjectId);
    objectOutput.writeLong(createrUserId);
    objectOutput.writeLong(createDate);// ww w  .  j a va 2 s.com
    objectOutput.writeLong(modifiedUserId);
    objectOutput.writeLong(modifiedDate);

    if (objekttyp == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(objekttyp);
    }

    objectOutput.writeLong(objektid);
    objectOutput.writeLong(folder);
}

From source file:at.graz.hmmc.liferay.portlet.puch.model.impl.PuchMuseumsObjektModelImpl.java

License:Open Source License

@Override
public String getObjekttyp() {
    if (_objekttyp == null) {
        return StringPool.BLANK;
    } else {/*w w w  .jav  a  2  s  .  c  o m*/
        return _objekttyp;
    }
}

From source file:at.graz.hmmc.liferay.portlet.puch.model.impl.TransaktionCacheModel.java

License:Open Source License

@Override
public Transaktion toEntityModel() {
    TransaktionImpl transaktionImpl = new TransaktionImpl();

    transaktionImpl.setTransaktionId(transaktionId);
    transaktionImpl.setCreaterUserId(createrUserId);

    if (createDate == Long.MIN_VALUE) {
        transaktionImpl.setCreateDate(null);
    } else {//from   ww w.  j  a  v  a 2  s  .c om
        transaktionImpl.setCreateDate(new Date(createDate));
    }

    transaktionImpl.setModifiedUserId(modifiedUserId);

    if (modifiedDate == Long.MIN_VALUE) {
        transaktionImpl.setModifiedDate(null);
    } else {
        transaktionImpl.setModifiedDate(new Date(modifiedDate));
    }

    if (typ == null) {
        transaktionImpl.setTyp(StringPool.BLANK);
    } else {
        transaktionImpl.setTyp(typ);
    }

    transaktionImpl.setPuchmuseumsobjectId(puchmuseumsobjectId);

    if (startDate == Long.MIN_VALUE) {
        transaktionImpl.setStartDate(null);
    } else {
        transaktionImpl.setStartDate(new Date(startDate));
    }

    if (endDate == Long.MIN_VALUE) {
        transaktionImpl.setEndDate(null);
    } else {
        transaktionImpl.setEndDate(new Date(endDate));
    }

    transaktionImpl.resetOriginalValues();

    return transaktionImpl;
}

From source file:at.graz.hmmc.liferay.portlet.puch.model.impl.TransaktionCacheModel.java

License:Open Source License

@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(transaktionId);
    objectOutput.writeLong(createrUserId);
    objectOutput.writeLong(createDate);/*from  www .  j  a v  a 2s .  c o  m*/
    objectOutput.writeLong(modifiedUserId);
    objectOutput.writeLong(modifiedDate);

    if (typ == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(typ);
    }

    objectOutput.writeLong(puchmuseumsobjectId);
    objectOutput.writeLong(startDate);
    objectOutput.writeLong(endDate);
}

From source file:at.graz.hmmc.liferay.portlet.puch.model.impl.TransaktionDataCacheModel.java

License:Open Source License

@Override
public TransaktionData toEntityModel() {
    TransaktionDataImpl transaktionDataImpl = new TransaktionDataImpl();

    transaktionDataImpl.setTransaktiondataId(transaktiondataId);
    transaktionDataImpl.setPuchmuseumsobjectId(puchmuseumsobjectId);
    transaktionDataImpl.setTransaktionId(transaktionId);

    if (objectkey == null) {
        transaktionDataImpl.setObjectkey(StringPool.BLANK);
    } else {/*from   w  ww .  jav  a 2  s  .  c o  m*/
        transaktionDataImpl.setObjectkey(objectkey);
    }

    if (objectvalue == null) {
        transaktionDataImpl.setObjectvalue(StringPool.BLANK);
    } else {
        transaktionDataImpl.setObjectvalue(objectvalue);
    }

    transaktionDataImpl.resetOriginalValues();

    return transaktionDataImpl;
}

From source file:at.graz.hmmc.liferay.portlet.puch.model.impl.TransaktionDataCacheModel.java

License:Open Source License

@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(transaktiondataId);
    objectOutput.writeLong(puchmuseumsobjectId);
    objectOutput.writeLong(transaktionId);

    if (objectkey == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {// w  ww .j  a v a2 s  .c o  m
        objectOutput.writeUTF(objectkey);
    }

    if (objectvalue == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(objectvalue);
    }
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ConfigurationPersistenceImpl.java

License:Open Source License

/**
 * Returns the configuration where scope = &#63; and optionkey = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
 *
 * @param scope the scope/*w  ww  .j  a va  2  s. com*/
 * @param optionkey the optionkey
 * @param retrieveFromCache whether to use the finder cache
 * @return the matching configuration, or <code>null</code> if a matching configuration could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Configuration fetchByoptionFinder(String scope, String optionkey, boolean retrieveFromCache)
        throws SystemException {
    Object[] finderArgs = new Object[] { scope, optionkey };

    Object result = null;

    if (retrieveFromCache) {
        result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_OPTIONFINDER, finderArgs, this);
    }

    if (result instanceof Configuration) {
        Configuration configuration = (Configuration) result;

        if (!Validator.equals(scope, configuration.getScope())
                || !Validator.equals(optionkey, configuration.getOptionkey())) {
            result = null;
        }
    }

    if (result == null) {
        StringBundler query = new StringBundler(4);

        query.append(_SQL_SELECT_CONFIGURATION_WHERE);

        boolean bindScope = false;

        if (scope == null) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_SCOPE_1);
        } else if (scope.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_SCOPE_3);
        } else {
            bindScope = true;

            query.append(_FINDER_COLUMN_OPTIONFINDER_SCOPE_2);
        }

        boolean bindOptionkey = false;

        if (optionkey == null) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_OPTIONKEY_1);
        } else if (optionkey.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_OPTIONKEY_3);
        } else {
            bindOptionkey = true;

            query.append(_FINDER_COLUMN_OPTIONFINDER_OPTIONKEY_2);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            if (bindScope) {
                qPos.add(scope);
            }

            if (bindOptionkey) {
                qPos.add(optionkey);
            }

            List<Configuration> list = q.list();

            if (list.isEmpty()) {
                FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_OPTIONFINDER, finderArgs, list);
            } else {
                if ((list.size() > 1) && _log.isWarnEnabled()) {
                    _log.warn(
                            "ConfigurationPersistenceImpl.fetchByoptionFinder(String, String, boolean) with parameters ("
                                    + StringUtil.merge(finderArgs)
                                    + ") yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder.");
                }

                Configuration configuration = list.get(0);

                result = configuration;

                cacheResult(configuration);

                if ((configuration.getScope() == null) || !configuration.getScope().equals(scope)
                        || (configuration.getOptionkey() == null)
                        || !configuration.getOptionkey().equals(optionkey)) {
                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_OPTIONFINDER, finderArgs, configuration);
                }
            }
        } catch (Exception e) {
            FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_OPTIONFINDER, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    if (result instanceof List<?>) {
        return null;
    } else {
        return (Configuration) result;
    }
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ConfigurationPersistenceImpl.java

License:Open Source License

/**
 * Returns the number of configurations where scope = &#63; and optionkey = &#63;.
 *
 * @param scope the scope//from w  w  w.j a  va2 s  . co  m
 * @param optionkey the optionkey
 * @return the number of matching configurations
 * @throws SystemException if a system exception occurred
 */
@Override
public int countByoptionFinder(String scope, String optionkey) throws SystemException {
    FinderPath finderPath = FINDER_PATH_COUNT_BY_OPTIONFINDER;

    Object[] finderArgs = new Object[] { scope, optionkey };

    Long count = (Long) FinderCacheUtil.getResult(finderPath, finderArgs, this);

    if (count == null) {
        StringBundler query = new StringBundler(3);

        query.append(_SQL_COUNT_CONFIGURATION_WHERE);

        boolean bindScope = false;

        if (scope == null) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_SCOPE_1);
        } else if (scope.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_SCOPE_3);
        } else {
            bindScope = true;

            query.append(_FINDER_COLUMN_OPTIONFINDER_SCOPE_2);
        }

        boolean bindOptionkey = false;

        if (optionkey == null) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_OPTIONKEY_1);
        } else if (optionkey.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_OPTIONFINDER_OPTIONKEY_3);
        } else {
            bindOptionkey = true;

            query.append(_FINDER_COLUMN_OPTIONFINDER_OPTIONKEY_2);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            if (bindScope) {
                qPos.add(scope);
            }

            if (bindOptionkey) {
                qPos.add(optionkey);
            }

            count = (Long) q.uniqueResult();

            FinderCacheUtil.putResult(finderPath, finderArgs, count);
        } catch (Exception e) {
            FinderCacheUtil.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return count.intValue();
}

From source file:at.graz.hmmc.liferay.portlet.puch.service.persistence.ConfigurationPersistenceImpl.java

License:Open Source License

/**
 * Returns the configuration where scope = &#63; and optionvalue = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
 *
 * @param scope the scope//ww  w  . j a v  a2s. co  m
 * @param optionvalue the optionvalue
 * @param retrieveFromCache whether to use the finder cache
 * @return the matching configuration, or <code>null</code> if a matching configuration could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public Configuration fetchByoptionsFinderValue(String scope, String optionvalue, boolean retrieveFromCache)
        throws SystemException {
    Object[] finderArgs = new Object[] { scope, optionvalue };

    Object result = null;

    if (retrieveFromCache) {
        result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_OPTIONSFINDERVALUE, finderArgs, this);
    }

    if (result instanceof Configuration) {
        Configuration configuration = (Configuration) result;

        if (!Validator.equals(scope, configuration.getScope())
                || !Validator.equals(optionvalue, configuration.getOptionvalue())) {
            result = null;
        }
    }

    if (result == null) {
        StringBundler query = new StringBundler(4);

        query.append(_SQL_SELECT_CONFIGURATION_WHERE);

        boolean bindScope = false;

        if (scope == null) {
            query.append(_FINDER_COLUMN_OPTIONSFINDERVALUE_SCOPE_1);
        } else if (scope.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_OPTIONSFINDERVALUE_SCOPE_3);
        } else {
            bindScope = true;

            query.append(_FINDER_COLUMN_OPTIONSFINDERVALUE_SCOPE_2);
        }

        boolean bindOptionvalue = false;

        if (optionvalue == null) {
            query.append(_FINDER_COLUMN_OPTIONSFINDERVALUE_OPTIONVALUE_1);
        } else if (optionvalue.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_OPTIONSFINDERVALUE_OPTIONVALUE_3);
        } else {
            bindOptionvalue = true;

            query.append(_FINDER_COLUMN_OPTIONSFINDERVALUE_OPTIONVALUE_2);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            if (bindScope) {
                qPos.add(scope);
            }

            if (bindOptionvalue) {
                qPos.add(optionvalue);
            }

            List<Configuration> list = q.list();

            if (list.isEmpty()) {
                FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_OPTIONSFINDERVALUE, finderArgs, list);
            } else {
                if ((list.size() > 1) && _log.isWarnEnabled()) {
                    _log.warn(
                            "ConfigurationPersistenceImpl.fetchByoptionsFinderValue(String, String, boolean) with parameters ("
                                    + StringUtil.merge(finderArgs)
                                    + ") yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder.");
                }

                Configuration configuration = list.get(0);

                result = configuration;

                cacheResult(configuration);

                if ((configuration.getScope() == null) || !configuration.getScope().equals(scope)
                        || (configuration.getOptionvalue() == null)
                        || !configuration.getOptionvalue().equals(optionvalue)) {
                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_OPTIONSFINDERVALUE, finderArgs,
                            configuration);
                }
            }
        } catch (Exception e) {
            FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_OPTIONSFINDERVALUE, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    if (result instanceof List<?>) {
        return null;
    } else {
        return (Configuration) result;
    }
}