Package javax.ejb

Examples of javax.ejb.ObjectNotFoundException


    try {
      dataAccessLayer.setSql("reports.findreportcontentbypk");
      dataAccessLayer.setInt(1, pk.reportContentId);
      resultSet = dataAccessLayer.executeQueryNonParsed();
      if (!resultSet.next()) {
        throw new ObjectNotFoundException("Primary key does not exist");
      }
      return pk;
    }
    catch(SQLException e) {
      throw new EJBException("Error executing SQL SELECT reportcontentid FROM reportcontent WHERE reportcontentid = ?: " + e.toString());
View Full Code Here


    try {
      dataAccessLayer.setSql("reports.findreportbypk");
      dataAccessLayer.setInt(1, pk.reportId);
      resultSet = dataAccessLayer.executeQueryNonParsed();
      if (!resultSet.next()) {
        throw new ObjectNotFoundException("Cannot Find report: "+pk.toString());
      }
      return pk;
    } catch (SQLException e) {
      throw new EJBException("Error executing SQL SELECT reportid FROM report WHERE reportid = ?: " + e.toString());
    } finally {
View Full Code Here

    try {
      dataAccessLayer.setSqlQuery("SELECT reporttypeid FROM reporttype WHERE reporttypeid = ?");
      dataAccessLayer.setInt(1, pk.reportTypeId);
      resultSet = dataAccessLayer.executeQueryNonParsed();
      if (!resultSet.next()) {
        throw new ObjectNotFoundException("Primary key does not exist");
      }
      return pk;
    }
    catch(SQLException e) {
      throw new EJBException("Error executing SQL SELECT reporttypeid FROM reporttype WHERE reporttypeid = ?: " + e.toString());
View Full Code Here

        TransactionPolicy txPolicy = createTransactionPolicy(deploymentInfo.getTransactionType(callMethod), callContext);

        try {
            EntityBean bean = (EntityBean) cmpEngine.loadBean(callContext, args[0]);
            if (bean == null) {
                throw new ObjectNotFoundException(deploymentInfo.getDeploymentID() + " : " + args[0]);
            }

            // rebuild the primary key
            KeyGenerator kg = deploymentInfo.getKeyGenerator();
            Object primaryKey = kg.getPrimaryKey(bean);
View Full Code Here

                } else {
                    return proxies;
                }
            } else {
                if (results.size() != 1) {
                    throw new ObjectNotFoundException("A Enteprise bean with deployment_id = " + deploymentInfo.getDeploymentID() + " and primarykey = " + args[0] + " Does not exist");
                }

                // create a new ProxyInfo based on the deployment info and primary key
                EntityBean bean = (EntityBean) results.get(0);
                if (bean == null) {
View Full Code Here

                return proxies;
            }

            // single valued query that returned no rows, is an exception
            if (proxies.isEmpty()) {
                throw new ObjectNotFoundException();
            }

            // return the single item.... multiple return values was handled in for loop above
            Object returnValue = proxies.iterator().next();
            return returnValue;
View Full Code Here

        txPolicy.beforeInvoke(null, txContext);
        try {
            CmpEngine cmpEngine = getCmpEngine(deploymentInfo);
            EntityBean bean = (EntityBean) cmpEngine.loadBean(callContext, args[0]);
            if (bean == null) {
                throw new ObjectNotFoundException(deploymentInfo.getDeploymentID() + " : " + args[0]);
            }

            // rebuild the primary key
            KeyGenerator kg = deploymentInfo.getKeyGenerator();
            Object primaryKey = kg.getPrimaryKey(bean);
View Full Code Here

                } else {
                    return proxies;
                }
            } else {
                if (results.size() != 1) {
                    throw new ObjectNotFoundException("A Enteprise bean with deployment_id = " + deploymentInfo.getDeploymentID() + " and primarykey = " + args[0] + " Does not exist");
                }

                // create a new ProxyInfo based on the deployment info and primary key
                EntityBean bean = (EntityBean) results.get(0);
                if (bean == null) {
View Full Code Here

                return proxies;
            }

            // single valued query that returned no rows, is an exception
            if (proxies.isEmpty()) {
                throw new ObjectNotFoundException();
            }

            // return the single item.... multpile return values was handled in for loop above
            Object returnValue = proxies.iterator().next();
            return returnValue;
View Full Code Here

        TransactionPolicy txPolicy = createTransactionPolicy(beanContext.getTransactionType(callMethod, interfaceType), callContext);

        try {
            EntityBean bean = (EntityBean) cmpEngine.loadBean(callContext, args[0]);
            if (bean == null) {
                throw new ObjectNotFoundException(beanContext.getDeploymentID() + " : " + args[0]);
            }

            // rebuild the primary key
            KeyGenerator kg = beanContext.getKeyGenerator();
            Object primaryKey = kg.getPrimaryKey(bean);
View Full Code Here

TOP

Related Classes of javax.ejb.ObjectNotFoundException

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.