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

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


  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_SLIBRARY);

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


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

    try {
      session = openSession();

      SBook sBook = (SBook)session.get(SBookImpl.class, primaryKey);

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

  @Override
  protected SBook removeImpl(SBook sBook) throws SystemException {
    sBook = toUnwrappedModel(sBook);

    Session session = null;

    try {
      session = openSession();

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

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

    boolean isNew = sBook.isNew();

    Session session = null;

    try {
      session = openSession();

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

    if (sBook == _nullSBook) {
      return null;
    }

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

      boolean hasException = false;

      try {
        session = openSession();

        sBook = (SBook)session.get(SBookImpl.class, Long.valueOf(bookId));
      }
      catch (Exception e) {
        hasException = true;

        throw processException(e);
View Full Code Here

      }
      else {
        sql = _SQL_SELECT_SBOOK;
      }

      Session session = null;

      try {
        session = openSession();

        Query q = session.createQuery(sql);

        if (orderByComparator == null) {
          list = (List<SBook>)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_SBOOK);

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

public class TestFinderImpl extends BasePersistenceImpl implements TestFinder {

    public List search() throws SystemException {
        List result = new ArrayList<Long>();
        Session session = null;

        try {
            session = openSession();
            String qString = "SELECT Transaction.id, Book.id, Book.title, max(Transaction.id) AS max_Transaction__id FROM Transaction  RIGHT JOIN Book  ON Book.id = Transaction.bookId  GROUP BY Book.title";
//            String qString = "SELECT Transaction.id, Book.id, Book.title FROM Transaction  RIGHT JOIN Book  ON Book.id = Transaction.bookId";
            SQLQuery query = session.createSQLQuery(qString, true);
            query.addScalar("Book.id", Type.LONG);
            query.addScalar("Transaction.id", Type.LONG);
            query.addScalar("Book.title", Type.STRING);
            query.addScalar("max_Transaction__id", Type.LONG);
            System.out.println(qString);
View Full Code Here

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

    try {
      session = openSession();

      STransaction sTransaction = (STransaction)session.get(STransactionImpl.class,
          primaryKey);

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

  @Override
  protected STransaction removeImpl(STransaction sTransaction)
    throws SystemException {
    sTransaction = toUnwrappedModel(sTransaction);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, sTransaction);
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.