Package javax.ejb

Examples of javax.ejb.ObjectNotFoundException


                } 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

/* 331 */           throw new FinderException("More than one instance matches the single-object finder criteria: " + list);
/*     */         }
/*     */       }
/*     */       else
/*     */       {
/* 336 */         throw new ObjectNotFoundException();
/*     */       }
/*     */     }
/*     */     catch (FinderException e)
/*     */     {
/* 341 */       throw e;
View Full Code Here

/* 59 */     JDBCQueryCommand query = this.manager.getQueryManager().getQueryCommand(finderMethod);
/*    */
/* 61 */     Collection result = query.execute(finderMethod, args, ctx, factory);
/* 62 */     if (result.isEmpty())
/*    */     {
/* 64 */       throw new ObjectNotFoundException("No such entity!");
/*    */     }
/* 66 */     if (result.size() == 1)
/*    */     {
/* 68 */       return result.iterator().next();
/*    */     }
View Full Code Here

/* 107 */     if (!cached)
/*     */     {
/* 109 */       Object instance = super.executeFetchOne(args, factory);
/* 110 */       if (instance == null)
/*     */       {
/* 112 */         throw new ObjectNotFoundException("Instance not find: entity=" + this.entity.getEntityName() + ", pk=" + pk);
/*     */       }
/*     */     }
/*     */     else
/*     */     {
/* 117 */       instance = factory.getEntityEJBObject(pk);
View Full Code Here

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

                        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

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.