Package com.ibatis.dao.client

Examples of com.ibatis.dao.client.DaoException


      throws DaoException {

    // Check arguments
    if (server == null) {

      throw new DaoException("Toplink Server not available");

    }

    // Set the server settings
    this.unitOfWork = uow;
View Full Code Here


      return session;

    } catch (TopLinkException e) {

      throw new DaoException("Error aquiring Session", e);

    }

  }
View Full Code Here

      return unitOfWork;

    } catch (TopLinkException e) {

      throw new DaoException("Error acquiring UnitOfWork.", e);

    }

  }
View Full Code Here

  public void commit() throws DaoException {

    // Make sure the transaction has not been committed
    if (commmitted) {

      throw new DaoException("Transaction already committed");

    }

    // Now try to commit the transaction
    try {

      // Check for UnitOfWork
      if (unitOfWork != null) {

        // UnitOfWork was not lazily loaded
        unitOfWork.commit();
        unitOfWork.release();
        session.release();

      }

    } catch (TopLinkException e) {

      throw new DaoException("Error committing transaction", e);

    }
    commmitted = true;

  }
View Full Code Here

        }

      } catch (TopLinkException e) {

        throw new DaoException("Error rolling back transaction", e);

      }

    }
View Full Code Here

      server = (Server) manager.getSession(sessionName,
          ToplinkDaoTransactionManager.class.getClassLoader());

    } catch (Exception e) {

      throw new DaoException(
          "Error configuring Toplink environment for session: "
              + sessionName);

    }
View Full Code Here

  public void addContext(DaoContext context) {
    // Add context ID mapping
    if (context.getId() != null && context.getId().length() > 0) {
      if (idContextMap.containsKey(context.getId())) {
        throw new DaoException("There is already a DAO Context with the ID '" + context.getId() + "'.");
      }
      idContextMap.put(context.getId(), context);
    }
    // Add type mappings
    Iterator i = context.getDaoImpls();
View Full Code Here

  }

  public Dao getDao(Class iface) {
    DaoContext context = (DaoContext) typeContextMap.get(iface);
    if (context == null) {
      throw new DaoException("There is no DAO implementation found for " + iface + " in any context. If you've " +
          "registered multiple implementations of this DAO, you must specify the Context ID for the DAO implementation" +
          "you're looking for using the getDao(Class iface, String contextId) method.");
    }
    return context.getDao(iface);
  }
View Full Code Here

  }

  public Dao getDao(Class iface, String contextId) {
    DaoContext context = (DaoContext) idContextMap.get(contextId);
    if (context == null) {
      throw new DaoException("There is no Context found with the ID " + contextId + ".");
    }
    return context.getDao(iface);
  }
View Full Code Here

    this.transactionManager = transactionManager;
  }

  public void addDao(DaoImpl daoImpl) {
    if (typeDaoImplMap.containsKey(daoImpl.getDaoInterface())) {
      throw new DaoException("More than one implementation for '" + daoImpl.getDaoInterface() + "' was configured.  " +
          "Only one implementation per context is allowed.");
    }
    typeDaoImplMap.put(daoImpl.getDaoInterface(), daoImpl);
  }
View Full Code Here

TOP

Related Classes of com.ibatis.dao.client.DaoException

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.