com.liferay.portal.kernel.dao.orm.Query.uniqueResult()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(11.4k)|赞(0)|评价(0)|浏览(263)

本文整理了Java中com.liferay.portal.kernel.dao.orm.Query.uniqueResult方法的一些代码示例,展示了Query.uniqueResult的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.uniqueResult方法的具体详情如下:
包路径:com.liferay.portal.kernel.dao.orm.Query
类名称:Query
方法名:uniqueResult

Query.uniqueResult介绍

暂无

代码示例

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm data provider instance links.
 *
 * @return the number of ddm data provider instance links
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMDATAPROVIDERINSTANCELINK);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm structure layouts.
 *
 * @return the number of ddm structure layouts
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTURELAYOUT);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm structure versions.
 *
 * @return the number of ddm structure versions
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTUREVERSION);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm form instance records.
 *
 * @return the number of ddm form instance records
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMFORMINSTANCERECORD);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.journal.service

/**
 * Returns the number of journal feeds.
 *
 * @return the number of journal feeds
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_JOURNALFEED);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm structure links.
 *
 * @return the number of ddm structure links
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTURELINK);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.journal.service

/**
 * Returns the number of journal folders.
 *
 * @return the number of journal folders
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_JOURNALFOLDER);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm form instance record versions.
 *
 * @return the number of ddm form instance record versions
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMFORMINSTANCERECORDVERSION);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm form instance versions.
 *
 * @return the number of ddm form instance versions
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMFORMINSTANCEVERSION);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm template links.
 *
 * @return the number of ddm template links
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMTEMPLATELINK);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.journal.service

/**
 * Returns the number of journal article localizations.
 *
 * @return the number of journal article localizations
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_JOURNALARTICLELOCALIZATION);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm structures.
 *
 * @return the number of ddm structures
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTURE);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm storage links.
 *
 * @return the number of ddm storage links
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMSTORAGELINK);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm templates.
 *
 * @return the number of ddm templates
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMTEMPLATE);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

/**
 * Returns the number of ddm template versions.
 *
 * @return the number of ddm template versions
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_DDMTEMPLATEVERSION);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.journal.service

/**
 * Returns the number of journal content searchs.
 *
 * @return the number of journal content searchs
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_JOURNALCONTENTSEARCH);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.journal.service

/**
 * Returns the number of journal article resources.
 *
 * @return the number of journal article resources
 */
@Override
public int countAll() {
  Long count = (Long)finderCache.getResult(_finderPathCountAll,
      FINDER_ARGS_EMPTY, this);
  if (count == null) {
    Session session = null;
    try {
      session = openSession();
      Query q = session.createQuery(_SQL_COUNT_JOURNALARTICLERESOURCE);
      count = (Long)q.uniqueResult();
      finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
        count);
    }
    catch (Exception e) {
      finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
      throw processException(e);
    }
    finally {
      closeSession(session);
    }
  }
  return count.intValue();
}

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

count = (Long)q.uniqueResult();

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

count = (Long)q.uniqueResult();

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

count = (Long)q.uniqueResult();

相关文章