Package com.dotcms.repackage.net.sf.hibernate

Examples of com.dotcms.repackage.net.sf.hibernate.Session


  protected com.liferay.portal.model.Address[] findByUserId_PrevAndNext(
    String addressId, String userId, OrderByComparator obc)
    throws NoSuchAddressException, SystemException {
    com.liferay.portal.model.Address address = findByPrimaryKey(addressId);
    int count = countByUserId(userId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("userId = ?");
      query.append(" ");

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }
      else {
        query.append("ORDER BY ");
        query.append("companyId ASC").append(", ");
        query.append("className ASC").append(", ");
        query.append("classPK ASC").append(", ");
        query.append("priority ASC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, userId);

      com.liferay.portal.model.Address[] array = new com.liferay.portal.model.Address[3];
      ScrollableResults sr = q.scroll();
View Full Code Here


    }
  }

  protected List findByC_C(String companyId, String className)
    throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("companyId = ?");
      query.append(" AND ");
      query.append("className = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("companyId ASC").append(", ");
      query.append("className ASC").append(", ");
      query.append("classPK ASC").append(", ");
      query.append("priority ASC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, companyId);
      q.setString(queryPos++, className);

      Iterator itr = q.list().iterator();
View Full Code Here

    return findByC_C(companyId, className, begin, end, null);
  }

  protected List findByC_C(String companyId, String className, int begin,
    int end, OrderByComparator obc) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("companyId = ?");
      query.append(" AND ");
      query.append("className = ?");
      query.append(" ");

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }
      else {
        query.append("ORDER BY ");
        query.append("companyId ASC").append(", ");
        query.append("className ASC").append(", ");
        query.append("classPK ASC").append(", ");
        query.append("priority ASC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, companyId);
      q.setString(queryPos++, className);

      List list = new ArrayList();
View Full Code Here

  protected com.liferay.portal.model.Address[] findByC_C_PrevAndNext(
    String addressId, String companyId, String className,
    OrderByComparator obc) throws NoSuchAddressException, SystemException {
    com.liferay.portal.model.Address address = findByPrimaryKey(addressId);
    int count = countByC_C(companyId, className);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("companyId = ?");
      query.append(" AND ");
      query.append("className = ?");
      query.append(" ");

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }
      else {
        query.append("ORDER BY ");
        query.append("companyId ASC").append(", ");
        query.append("className ASC").append(", ");
        query.append("classPK ASC").append(", ");
        query.append("priority ASC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, companyId);
      q.setString(queryPos++, className);

      com.liferay.portal.model.Address[] array = new com.liferay.portal.model.Address[3];
View Full Code Here

    }
  }

  protected List findByC_C_C(String companyId, String className,
    String classPK) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("companyId = ?");
      query.append(" AND ");
      query.append("className = ?");
      query.append(" AND ");
      query.append("classPK = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("companyId ASC").append(", ");
      query.append("className ASC").append(", ");
      query.append("classPK ASC").append(", ");
      query.append("priority ASC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, companyId);
      q.setString(queryPos++, className);
      q.setString(queryPos++, classPK);
View Full Code Here

  }

  protected List findByC_C_C(String companyId, String className,
    String classPK, int begin, int end, OrderByComparator obc)
    throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("companyId = ?");
      query.append(" AND ");
      query.append("className = ?");
      query.append(" AND ");
      query.append("classPK = ?");
      query.append(" ");

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }
      else {
        query.append("ORDER BY ");
        query.append("companyId ASC").append(", ");
        query.append("className ASC").append(", ");
        query.append("classPK ASC").append(", ");
        query.append("priority ASC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, companyId);
      q.setString(queryPos++, className);
      q.setString(queryPos++, classPK);
View Full Code Here

  protected com.liferay.portal.model.Address[] findByC_C_C_PrevAndNext(
    String addressId, String companyId, String className, String classPK,
    OrderByComparator obc) throws NoSuchAddressException, SystemException {
    com.liferay.portal.model.Address address = findByPrimaryKey(addressId);
    int count = countByC_C_C(companyId, className, classPK);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("companyId = ?");
      query.append(" AND ");
      query.append("className = ?");
      query.append(" AND ");
      query.append("classPK = ?");
      query.append(" ");

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }
      else {
        query.append("ORDER BY ");
        query.append("companyId ASC").append(", ");
        query.append("className ASC").append(", ");
        query.append("classPK ASC").append(", ");
        query.append("priority ASC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, companyId);
      q.setString(queryPos++, className);
      q.setString(queryPos++, classPK);
View Full Code Here

      HibernateUtil.closeSession(session);
    }
  }

  protected List findAll() throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM ");
      query.append("ORDER BY ");
      query.append("companyId ASC").append(", ");
      query.append("className ASC").append(", ");
      query.append("classPK ASC").append(", ");
      query.append("priority ASC");

      Iterator itr = session.find(query.toString()).iterator();
      List list = new ArrayList();

      while (itr.hasNext()) {
        AddressHBM addressHBM = (AddressHBM)itr.next();
        list.add(AddressHBMUtil.model(addressHBM));
View Full Code Here

    }
  }

  protected void removeByCompanyId(String companyId)
    throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("companyId = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("companyId ASC").append(", ");
      query.append("className ASC").append(", ");
      query.append("classPK ASC").append(", ");
      query.append("priority ASC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, companyId);

      Iterator itr = q.list().iterator();

      while (itr.hasNext()) {
        AddressHBM addressHBM = (AddressHBM)itr.next();
        AddressPool.remove((String)addressHBM.getPrimaryKey());
        session.delete(addressHBM);
      }

      session.flush();
    }
    catch (HibernateException he) {
      throw new SystemException(he);
    }
    finally {
View Full Code Here

      HibernateUtil.closeSession(session);
    }
  }

  protected void removeByUserId(String userId) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Address IN CLASS com.liferay.portal.ejb.AddressHBM WHERE ");
      query.append("userId = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("companyId ASC").append(", ");
      query.append("className ASC").append(", ");
      query.append("classPK ASC").append(", ");
      query.append("priority ASC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, userId);

      Iterator itr = q.list().iterator();

      while (itr.hasNext()) {
        AddressHBM addressHBM = (AddressHBM)itr.next();
        AddressPool.remove((String)addressHBM.getPrimaryKey());
        session.delete(addressHBM);
      }

      session.flush();
    }
    catch (HibernateException he) {
      throw new SystemException(he);
    }
    finally {
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.net.sf.hibernate.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.