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

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


   * @throws com.liferay.socialnetworking.NoSuchWallEntryException if a wall entry with the primary key could not be found
   * @throws SystemException if a system exception occurred
   */
  public WallEntry remove(long wallEntryId)
    throws NoSuchWallEntryException, SystemException {
    Session session = null;

    try {
      session = openSession();

      WallEntry wallEntry = (WallEntry)session.get(WallEntryImpl.class,
          new Long(wallEntryId));

      if (wallEntry == null) {
        if (_log.isWarnEnabled()) {
          _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + wallEntryId);
View Full Code Here


  protected WallEntry removeImpl(WallEntry wallEntry)
    throws SystemException {
    wallEntry = toUnwrappedModel(wallEntry);

    Session session = null;

    try {
      session = openSession();

      if (wallEntry.isCachedModel() || BatchSessionUtil.isEnabled()) {
        Object staleObject = session.get(WallEntryImpl.class,
            wallEntry.getPrimaryKeyObj());

        if (staleObject != null) {
          session.evict(staleObject);
        }
      }

      session.delete(wallEntry);

      session.flush();
    }
    catch (Exception e) {
      throw processException(e);
    }
    finally {
View Full Code Here

  public WallEntry updateImpl(
    com.liferay.socialnetworking.model.WallEntry wallEntry, boolean merge)
    throws SystemException {
    wallEntry = toUnwrappedModel(wallEntry);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, wallEntry, merge);
View Full Code Here

    throws SystemException {
    WallEntry wallEntry = (WallEntry)EntityCacheUtil.getResult(WallEntryModelImpl.ENTITY_CACHE_ENABLED,
        WallEntryImpl.class, wallEntryId, this);

    if (wallEntry == null) {
      Session session = null;

      try {
        session = openSession();

        wallEntry = (WallEntry)session.get(WallEntryImpl.class,
            new Long(wallEntryId));
      }
      catch (Exception e) {
        throw processException(e);
      }
View Full Code Here

    List<WallEntry> list = (List<WallEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_GROUPID,
        finderArgs, this);

    if (list == null) {
      Session session = null;

      try {
        session = openSession();

        StringBundler query = null;

        if (orderByComparator != null) {
          query = new StringBundler(3 +
              (orderByComparator.getOrderByFields().length * 3));
        }
        else {
          query = new StringBundler(3);
        }

        query.append(_SQL_SELECT_WALLENTRY_WHERE);

        query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);

        if (orderByComparator != null) {
          appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
            orderByComparator);
        }

        else {
          query.append(WallEntryModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Query q = session.createQuery(sql);

        QueryPos qPos = QueryPos.getInstance(q);

        qPos.add(groupId);

View Full Code Here

  public WallEntry[] findByGroupId_PrevAndNext(long wallEntryId,
    long groupId, OrderByComparator orderByComparator)
    throws NoSuchWallEntryException, SystemException {
    WallEntry wallEntry = findByPrimaryKey(wallEntryId);

    Session session = null;

    try {
      session = openSession();

      WallEntry[] array = new WallEntryImpl[3];
View Full Code Here

    List<WallEntry> list = (List<WallEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_USERID,
        finderArgs, this);

    if (list == null) {
      Session session = null;

      try {
        session = openSession();

        StringBundler query = null;

        if (orderByComparator != null) {
          query = new StringBundler(3 +
              (orderByComparator.getOrderByFields().length * 3));
        }
        else {
          query = new StringBundler(3);
        }

        query.append(_SQL_SELECT_WALLENTRY_WHERE);

        query.append(_FINDER_COLUMN_USERID_USERID_2);

        if (orderByComparator != null) {
          appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
            orderByComparator);
        }

        else {
          query.append(WallEntryModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Query q = session.createQuery(sql);

        QueryPos qPos = QueryPos.getInstance(q);

        qPos.add(userId);

View Full Code Here

  public WallEntry[] findByUserId_PrevAndNext(long wallEntryId, long userId,
    OrderByComparator orderByComparator)
    throws NoSuchWallEntryException, SystemException {
    WallEntry wallEntry = findByPrimaryKey(wallEntryId);

    Session session = null;

    try {
      session = openSession();

      WallEntry[] array = new WallEntryImpl[3];
View Full Code Here

    List<WallEntry> list = (List<WallEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_U,
        finderArgs, this);

    if (list == null) {
      Session session = null;

      try {
        session = openSession();

        StringBundler query = null;

        if (orderByComparator != null) {
          query = new StringBundler(4 +
              (orderByComparator.getOrderByFields().length * 3));
        }
        else {
          query = new StringBundler(4);
        }

        query.append(_SQL_SELECT_WALLENTRY_WHERE);

        query.append(_FINDER_COLUMN_G_U_GROUPID_2);

        query.append(_FINDER_COLUMN_G_U_USERID_2);

        if (orderByComparator != null) {
          appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
            orderByComparator);
        }

        else {
          query.append(WallEntryModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Query q = session.createQuery(sql);

        QueryPos qPos = QueryPos.getInstance(q);

        qPos.add(groupId);

View Full Code Here

  public WallEntry[] findByG_U_PrevAndNext(long wallEntryId, long groupId,
    long userId, OrderByComparator orderByComparator)
    throws NoSuchWallEntryException, SystemException {
    WallEntry wallEntry = findByPrimaryKey(wallEntryId);

    Session session = null;

    try {
      session = openSession();

      WallEntry[] array = new WallEntryImpl[3];
View Full Code Here

TOP

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

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.