Package com.liferay.portal.kernel.dao.orm

Examples of com.liferay.portal.kernel.dao.orm.SQLQuery


    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
        Location.class.getName(),
        _FILTER_ENTITY_TABLE_FILTER_PK_COLUMN, groupId);

    SQLQuery q = session.createSQLQuery(sql);

    q.setFirstResult(0);
    q.setMaxResults(2);

    if (getDB().isSupportsInlineDistinct()) {
      q.addEntity(_FILTER_ENTITY_ALIAS, LocationImpl.class);
    }
    else {
      q.addEntity(_FILTER_ENTITY_TABLE, LocationImpl.class);
    }

    QueryPos qPos = QueryPos.getInstance(q);

    qPos.add(groupId);

    if (orderByComparator != null) {
      Object[] values = orderByComparator.getOrderByConditionValues(location);

      for (Object value : values) {
        qPos.add(value);
      }
    }

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

    if (list.size() == 2) {
      return list.get(1);
    }
    else {
View Full Code Here


    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

      q.addScalar(COUNT_COLUMN_NAME,
        com.liferay.portal.kernel.dao.orm.Type.LONG);

      QueryPos qPos = QueryPos.getInstance(q);

      qPos.add(groupId);

      Long count = (Long)q.uniqueResult();

      return count.intValue();
    }
    catch (Exception e) {
      throw processException(e);
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

      if (getDB().isSupportsInlineDistinct()) {
        q.addEntity(_FILTER_ENTITY_ALIAS, EntryImpl.class);
      }
      else {
        q.addEntity(_FILTER_ENTITY_TABLE, EntryImpl.class);
      }

      QueryPos qPos = QueryPos.getInstance(q);

      qPos.add(groupId);
View Full Code Here

    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
        Entry.class.getName(), _FILTER_ENTITY_TABLE_FILTER_PK_COLUMN,
        groupId);

    SQLQuery q = session.createSQLQuery(sql);

    q.setFirstResult(0);
    q.setMaxResults(2);

    if (getDB().isSupportsInlineDistinct()) {
      q.addEntity(_FILTER_ENTITY_ALIAS, EntryImpl.class);
    }
    else {
      q.addEntity(_FILTER_ENTITY_TABLE, EntryImpl.class);
    }

    QueryPos qPos = QueryPos.getInstance(q);

    qPos.add(groupId);

    qPos.add(guestbookId);

    if (orderByComparator != null) {
      Object[] values = orderByComparator.getOrderByConditionValues(entry);

      for (Object value : values) {
        qPos.add(value);
      }
    }

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

    if (list.size() == 2) {
      return list.get(1);
    }
    else {
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

      q.addScalar(COUNT_COLUMN_NAME,
        com.liferay.portal.kernel.dao.orm.Type.LONG);

      QueryPos qPos = QueryPos.getInstance(q);

      qPos.add(groupId);

      qPos.add(guestbookId);

      Long count = (Long)q.uniqueResult();

      return count.intValue();
    }
    catch (Exception e) {
      throw processException(e);
View Full Code Here

TOP

Related Classes of com.liferay.portal.kernel.dao.orm.SQLQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.