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

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


    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_U_ME,
        finderArgs, this);

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

      try {
        session = openSession();

        StringBundler query = new StringBundler(3);

        query.append(_SQL_COUNT_MEETUPSREGISTRATION_WHERE);

        query.append(_FINDER_COLUMN_U_ME_USERID_2);

        query.append(_FINDER_COLUMN_U_ME_MEETUPSENTRYID_2);

        String sql = query.toString();

        Query q = session.createQuery(sql);

        QueryPos qPos = QueryPos.getInstance(q);

        qPos.add(userId);
View Full Code Here


    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_ME_S,
        finderArgs, this);

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

      try {
        session = openSession();

        StringBundler query = new StringBundler(3);

        query.append(_SQL_COUNT_MEETUPSREGISTRATION_WHERE);

        query.append(_FINDER_COLUMN_ME_S_MEETUPSENTRYID_2);

        query.append(_FINDER_COLUMN_ME_S_STATUS_2);

        String sql = query.toString();

        Query q = session.createQuery(sql);

        QueryPos qPos = QueryPos.getInstance(q);

        qPos.add(meetupsEntryId);
View Full Code Here

    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
        finderArgs, this);

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

      try {
        session = openSession();

        Query q = session.createQuery(_SQL_COUNT_MEETUPSREGISTRATION);

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

    public void closeConnection(DBConnection connection) throws DBException {
        connectionManager.closeConnection(connection);
    }

    public void executeUpdate(DBConnection dbConnection, String sql, List params, Map<String, Object> options) throws DBException {
        Session session = (Session) dbConnection.getNativeConnection();
        SQLQuery query = null;

        try {
            query = session.createSQLQuery(sql);
            QueryPos qpos = QueryPos.getInstance(query);
            for (Object item: params) {
                qpos.add(item);
            }
            log.debug(sql + "\n" + params);
View Full Code Here

        }
    }

    public List executeQuery(DBConnection dbConnection, String sql, List params,  LinkedHashMap<String, Integer> types) throws DBException {
        List items = new ArrayList();
        Session session = (Session) dbConnection.getNativeConnection();
        SQLQuery query = null;

        try {
            query = session.createSQLQuery(sql);
            QueryPos qpos = QueryPos.getInstance(query);
            for (Object item: params) {
                qpos.add(item);
            }
            log.debug(sql + "\n" + params);
View Full Code Here

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

    try {
      session = openSession();

      SLibrary sLibrary = (SLibrary)session.get(SLibraryImpl.class,
          primaryKey);

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

  @Override
  protected SLibrary removeImpl(SLibrary sLibrary) throws SystemException {
    sLibrary = toUnwrappedModel(sLibrary);

    Session session = null;

    try {
      session = openSession();

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

    throws SystemException {
    sLibrary = toUnwrappedModel(sLibrary);

    boolean isNew = sLibrary.isNew();

    Session session = null;

    try {
      session = openSession();

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

    if (sLibrary == _nullSLibrary) {
      return null;
    }

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

      boolean hasException = false;

      try {
        session = openSession();

        sLibrary = (SLibrary)session.get(SLibraryImpl.class,
            Long.valueOf(libraryId));
      }
      catch (Exception e) {
        hasException = true;
View Full Code Here

      }
      else {
        sql = _SQL_SELECT_SLIBRARY;
      }

      Session session = null;

      try {
        session = openSession();

        Query q = session.createQuery(sql);

        if (orderByComparator == null) {
          list = (List<SLibrary>)QueryUtil.list(q, getDialect(),
              start, end, false);
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.