Package javax.ejb

Examples of javax.ejb.ObjectNotFoundException


     * if no activity found.
     */
    public Integer ejbFindByPrimaryKey(Integer pk)
  throws FinderException {
  if (pk.intValue() != 0) {
            throw new ObjectNotFoundException();
  }
  return pk;
    }
View Full Code Here


      //pdir.remove();
      pdir.setIsDeleted(true);
     
      Collection versions = pdvh.findAllVersions(pdid);
      //force to remove the definition if there's no more version.
      if(!versions.iterator().hasNext()) throw new ObjectNotFoundException();
    }catch(javax.ejb.ObjectNotFoundException e){
      ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(tc);   
      ProcessDefinitionRepositoryLocal pdr = pdhr.findByPrimaryKey(pdid);
     
      //don't remove
View Full Code Here

      if (rs.next()) {
        balance = rs.getDouble(1);
      } else {
        String error = "ejbFindByPrimaryKey: AccountBean (" + pk + ") not found";
        log(error);
        throw new ObjectNotFoundException (error);
       }
    } catch (SQLException sqe) {
      log("SQLException:  " + sqe);
      throw new EJBException (sqe);
    } finally {
View Full Code Here

      if (rs.next()) {
        balance = rs.getDouble(1);
      } else {
        String error = "ejbFindByPrimaryKey: AccountBean (" + pk + ") not found";
        log(error);
        throw new ObjectNotFoundException (error);
       }
    } catch (SQLException sqe) {
      String error = "SQLException:  " + sqe.getMessage();
      log(error);
      throw new EJBException (error);
View Full Code Here

        txPolicy.beforeInvoke(null, txContext);
        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.... multpile return values was handled in for loop above
            Object returnValue = proxies.iterator().next();
            return returnValue;
View Full Code Here

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

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

            // rebuild the primary key
            final KeyGenerator kg = beanContext.getKeyGenerator();
            final 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 = " +
                        beanContext.getDeploymentID() +
                        " and primarykey = " +
                        args[0] +
                        " Does not exist");
                }
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
            return proxies.iterator().next();
        } catch (final RuntimeException e) {
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.