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, GuestbookImpl.class);
      }
      else {
        q.addEntity(_FILTER_ENTITY_TABLE, GuestbookImpl.class);
      }

      QueryPos qPos = QueryPos.getInstance(q);

      qPos.add(groupId);
View Full Code Here

    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
        Guestbook.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, GuestbookImpl.class);
    }
    else {
      q.addEntity(_FILTER_ENTITY_TABLE, GuestbookImpl.class);
    }

    QueryPos qPos = QueryPos.getInstance(q);

    qPos.add(groupId);

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

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

    List<Guestbook> 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

    try {
      session = openSession();

      String sql = CustomSQLUtil.get(FIND_BY_EVENTNAME_EVENTDESCRIPTON_LOCATIONNAME);

      SQLQuery q = session.createSQLQuery(sql);
      q.setCacheable(false);
      q.addEntity("Event_Event", EventImpl.class);

      QueryPos qPos = QueryPos.getInstance(q);
      qPos.add(eventName);
      qPos.add(eventDescription);
      qPos.add(locationName);
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      SQLQuery q = session.createSQLQuery(sql);

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

      QueryPos qPos = QueryPos.getInstance(q);

      qPos.add(groupId);
View Full Code Here

    String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
        Event.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, EventImpl.class);
    }
    else {
      q.addEntity(_FILTER_ENTITY_TABLE, EventImpl.class);
    }

    QueryPos qPos = QueryPos.getInstance(q);

    qPos.add(groupId);

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

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

    List<Event> 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, EventImpl.class);
      }
      else {
        q.addEntity(_FILTER_ENTITY_TABLE, EventImpl.class);
      }

      QueryPos qPos = QueryPos.getInstance(q);

      qPos.add(groupId);
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.