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

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


   * @throws SystemException if a system exception occurred
   */
  @Override
  public SAuthor remove(Serializable primaryKey)
    throws NoSuchSAuthorException, SystemException {
    Session session = null;

    try {
      session = openSession();

      SAuthor sAuthor = (SAuthor)session.get(SAuthorImpl.class, primaryKey);

      if (sAuthor == null) {
        if (_log.isWarnEnabled()) {
          _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
        }
View Full Code Here


  @Override
  protected SAuthor removeImpl(SAuthor sAuthor) throws SystemException {
    sAuthor = toUnwrappedModel(sAuthor);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, sAuthor);
View Full Code Here

    boolean merge) throws SystemException {
    sAuthor = toUnwrappedModel(sAuthor);

    boolean isNew = sAuthor.isNew();

    Session session = null;

    try {
      session = openSession();

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

    if (sAuthor == _nullSAuthor) {
      return null;
    }

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

      boolean hasException = false;

      try {
        session = openSession();

        sAuthor = (SAuthor)session.get(SAuthorImpl.class,
            Long.valueOf(authorId));
      }
      catch (Exception e) {
        hasException = true;
View Full Code Here

      }
      else {
        sql = _SQL_SELECT_SAUTHOR;
      }

      Session session = null;

      try {
        session = openSession();

        Query q = session.createQuery(sql);

        if (orderByComparator == null) {
          list = (List<SAuthor>)QueryUtil.list(q, getDialect(),
              start, end, false);
View Full Code Here

  public int countAll() throws SystemException {
    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
        FINDER_ARGS_EMPTY, this);

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

      try {
        session = openSession();

        Query q = session.createQuery(_SQL_COUNT_SAUTHOR);

        count = (Long)q.uniqueResult();
      }
      catch (Exception e) {
        throw processException(e);
View Full Code Here

     * @throws SystemException if a system exception occurred
     */
    @Override
    public NotFound remove(Serializable primaryKey)
        throws NoSuchNotFoundException, SystemException {
        Session session = null;

        try {
            session = openSession();

            NotFound notFound = (NotFound) session.get(NotFoundImpl.class,
                    primaryKey);

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

    @Override
    protected NotFound removeImpl(NotFound notFound) throws SystemException {
        notFound = toUnwrappedModel(notFound);

        Session session = null;

        try {
            session = openSession();

            if (!session.contains(notFound)) {
                notFound = (NotFound) session.get(NotFoundImpl.class,
                        notFound.getPrimaryKeyObj());
            }

            if (notFound != null) {
                session.delete(notFound);
            }
        } catch (Exception e) {
            throw processException(e);
        } finally {
            closeSession(session);
View Full Code Here

        throws SystemException {
        notFound = toUnwrappedModel(notFound);

        boolean isNew = notFound.isNew();

        Session session = null;

        try {
            session = openSession();

            if (notFound.isNew()) {
                session.save(notFound);

                notFound.setNew(false);
            } else {
                session.merge(notFound);
            }
        } catch (Exception e) {
            throw processException(e);
        } finally {
            closeSession(session);
View Full Code Here

        if (notFound == _nullNotFound) {
            return null;
        }

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

            try {
                session = openSession();

                notFound = (NotFound) session.get(NotFoundImpl.class, primaryKey);

                if (notFound != null) {
                    cacheResult(notFound);
                } else {
                    EntityCacheUtil.putResult(NotFoundModelImpl.ENTITY_CACHE_ENABLED,
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.