Package javax.ejb

Examples of javax.ejb.ObjectNotFoundException


                        list.add(resultReader.readRow(rs, factory));
                    }
                    throw MESSAGES.moreThanOneInstanceForSingleValueFinder(list);
                }
            } else {
                throw new ObjectNotFoundException();
            }
        } catch (FinderException e) {
            throw e;
        } catch (Exception e) {
            FinderException fe = new FinderException(e.getMessage());
View Full Code Here


        }

        if (!Collection.class.isAssignableFrom(getReturnType())) {
            // single object
            if (retVal.size() == 0) {
                throw new ObjectNotFoundException();
            }
            if (retVal.size() > 1) {
                throw new FinderException(getSelectorName() +
                        " returned " + retVal.size() + " objects");
            }
View Full Code Here

        String msg = I18NHelper.getMessage(cmpMessages,
            "GEN.findbypk_exception_notfound", beanName, // NOI18N
            primaryKey.toString());

        cmpLifecycleLogger.log(Logger.FINER, msg, ex);
        throw new ObjectNotFoundException(msg);
    }
View Full Code Here

      conn = this.getConnection();
      ps = conn.prepareStatement(query);
      ps.setInt(1, primaryKey.intValue());
      result = ps.executeQuery();
      if (!result.next()) {
        throw new ObjectNotFoundException(
            "Customer not found with ID: " + primaryKey);
      }
    } catch (SQLException se) {
      throw new EJBException(se);
    } finally {
View Full Code Here

      conn = this.getConnection();
      ps = conn.prepareStatement(query);
      ps.setString(1, sssNo);
      result = ps.executeQuery();
      if (!result.next()) {
        throw new ObjectNotFoundException(
            "Customer not found with SSS_NO:" + sssNo);
      } else {
        customerId = result.getInt(1);
      }
      if (result.next()) {
View Full Code Here

      conn = this.getConnection();
      ps = conn.prepareStatement(query);
      ps.setInt(1, primaryKey.intValue());
      result = ps.executeQuery();
      if (!result.next()) {
        throw new ObjectNotFoundException(
            "Customer not found with ID: " + primaryKey);
      }
    } catch (SQLException se) {
      throw new EJBException(se);
    } finally {
View Full Code Here

      conn = this.getConnection();
      ps = conn.prepareStatement(query);
      ps.setString(1, sssNo);
      result = ps.executeQuery();
      if (!result.next()) {
        throw new ObjectNotFoundException(
            "Customer not found with SSS_NO:" + sssNo);
      } else {
        customerId = result.getInt(1);
      }
      if (result.next()) {
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

                } 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");
                }

                // 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

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.