Package javax.ejb

Examples of javax.ejb.NoSuchEntityException


         }
         return (Exception)e;
      }
      if (e instanceof NoSuchEntityException)
      {
         NoSuchEntityException noSuchEntityException =
               (NoSuchEntityException) e;
         if (noSuchEntityException.getCausedByException() != null)
         {
            log.error("NoSuchEntityException in method: " + invocation.getMethod() + ", causedBy:",
                  noSuchEntityException.getCausedByException());
         }
         else
         {
            log.error("NoSuchEntityException in method: " + invocation.getMethod() + ":", noSuchEntityException);
         }

         if (isLocal)
         {
            return new NoSuchObjectLocalException(
                  noSuchEntityException.getMessage(),
                  noSuchEntityException.getCausedByException());
         }
         else
         {
            NoSuchObjectException noSuchObjectException =
                  new NoSuchObjectException(noSuchEntityException.getMessage());
            noSuchObjectException.detail = noSuchEntityException;
            return noSuchObjectException;
         }
      }
      if (e instanceof EJBException)
View Full Code Here


            rs = ps.executeQuery();

            if(!rs.next())
            {
               throw new NoSuchEntityException("Row not found: " + pk);
            }

            value = field.loadArgumentResults(rs, 1);
         }
         catch(SQLException e)
View Full Code Here

         // to be nice we coerce the execption to an interface friendly type
         // before wrapping it with a transaction rolled back exception
         Throwable cause;
         if (e instanceof NoSuchEntityException)
         {
            NoSuchEntityException nsee = (NoSuchEntityException) e;
            if (isLocal)
            {
               cause = new NoSuchObjectLocalException(nsee.getMessage(),
                       nsee.getCausedByException());
            }
            else
            {
               cause = new NoSuchObjectException(nsee.getMessage());

               // set the detil of the exception
               ((NoSuchObjectException) cause).detail =
                       nsee.getCausedByException();
            }
         }
         else
         {
            if (isLocal)
View Full Code Here

         rs = ps.executeQuery();

         if(!rs.next())
         {
            throw new NoSuchEntityException("Row not found: " + id);
         }

         return view.loadRow(rs, id, false);
      }
      catch(SQLException e)
View Full Code Here

         // did we load the main results
         if (!mainEntityLoaded)
         {
            if (failIfNotFound)
               throw new NoSuchEntityException("Entity not found: primaryKey=" + ctx.getId());
            else
               return false;
         }
         else
            return true;
View Full Code Here

/* 200 */         throw ex;
/*     */       }
/*     */       Throwable cause;
/* 207 */       if ((e instanceof NoSuchEntityException))
/*     */       {
/* 209 */         NoSuchEntityException nsee = (NoSuchEntityException)e;
/*     */         Throwable cause;
/* 210 */         if (isLocal)
/*     */         {
/* 212 */           cause = new NoSuchObjectLocalException(nsee.getMessage(), nsee.getCausedByException());
/*     */         }
/*     */         else
/*     */         {
/* 217 */           Throwable cause = new NoSuchObjectException(nsee.getMessage());
/*     */
/* 220 */           ((NoSuchObjectException)cause).detail = nsee.getCausedByException();
/*     */         }
/*     */       }
/*     */       else
/*     */       {
/*     */         Throwable cause;
View Full Code Here

/*      */
/*  514 */       rs = ps.executeQuery();
/*      */
/*  516 */       if (!rs.next())
/*      */       {
/*  518 */         throw new NoSuchEntityException("Row not found: " + id);
/*      */       }
/*      */
/*  521 */       i = view.loadRow(rs, id, false);
/*      */     }
/*      */     catch (SQLException e)
View Full Code Here

/*      */
/* 1783 */         rs = ps.executeQuery();
/*      */
/* 1785 */         if (!rs.next())
/*      */         {
/* 1787 */           throw new NoSuchEntityException("Row not found: " + this.pk);
/*      */         }
/*      */
/* 1790 */         value = field.loadArgumentResults(rs, 1);
/*      */       }
/*      */       catch (SQLException e)
View Full Code Here

/*     */       }
/* 315 */       return (Exception)e;
/*     */     }
/* 317 */     if ((e instanceof NoSuchEntityException))
/*     */     {
/* 319 */       NoSuchEntityException noSuchEntityException = (NoSuchEntityException)e;
/*     */
/* 321 */       if (noSuchEntityException.getCausedByException() != null)
/*     */       {
/* 323 */         this.log.error("NoSuchEntityException in method: " + invocation.getMethod() + ", causedBy:", noSuchEntityException.getCausedByException());
/*     */       }
/*     */       else
/*     */       {
/* 328 */         this.log.error("NoSuchEntityException in method: " + invocation.getMethod() + ":", noSuchEntityException);
/*     */       }
/*     */
/* 331 */       if (isLocal)
/*     */       {
/* 333 */         return new NoSuchObjectLocalException(noSuchEntityException.getMessage(), noSuchEntityException.getCausedByException());
/*     */       }
/*     */
/* 339 */       NoSuchObjectException noSuchObjectException = new NoSuchObjectException(noSuchEntityException.getMessage());
/*     */
/* 341 */       noSuchObjectException.detail = noSuchEntityException;
/* 342 */       return noSuchObjectException;
/*     */     }
/*     */
View Full Code Here

TOP

Related Classes of javax.ejb.NoSuchEntityException

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.