Examples of DuplicateKeyException


Examples of javax.ejb.DuplicateKeyException

         }
         catch(SQLException e)
         {
            if("23000".equals(e.getSQLState()))
            {
               throw new DuplicateKeyException("Unique key violation or invalid foreign key value: pk=" + ctx.getId());
            }
            else
            {
               throw new CreateException("Failed to create instance: pk=" +
                  ctx.getId() +
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

         }
         catch(SQLException e)
         {
            if("23000".equals(e.getSQLState()))
            {
               throw new DuplicateKeyException("Unique key violation or invalid foreign key value: pk=" + ctx.getId());
            }
            else
            {
               throw new CreateException("Failed to create instance: pk=" +
                  ctx.getId() +
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

         }
         catch(SQLException e)
         {
            if("23000".equals(e.getSQLState()))
            {
               throw new DuplicateKeyException("Unique key violation or invalid foreign key value: pk=" + ctx.getId());
            }
            else
            {
               throw new CreateException("Failed to create instance: pk=" + ctx.getId() +
                  ", state=" + e.getSQLState() +
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

/*    */         {
/* 95 */           throw new CreateException("Error checking if entity with primary pk " + pk + "exists: SQL returned no rows");
/*    */         }
/* 97 */         if (rs.getInt(1) > 0)
/*    */         {
/* 99 */           throw new DuplicateKeyException("Entity with primary key " + pk + " already exists");
/*    */         }
/*    */       }
/*    */       catch (SQLException e)
/*    */       {
/* 104 */         this.log.error("Error checking if entity exists", e);
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

/*     */       }
/*     */       catch (SQLException e)
/*     */       {
/* 136 */         if ("23000".equals(e.getSQLState()))
/*     */         {
/* 138 */           throw new DuplicateKeyException("Unique key violation or invalid foreign key value: pk=" + ctx.getId());
/*     */         }
/*     */
/* 142 */         throw new CreateException("Failed to create instance: pk=" + ctx.getId() + ", state=" + e.getSQLState() + ", msg=" + e.getMessage());
/*     */       }
/*     */
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

/*     */       }
/*     */       catch (SQLException e)
/*     */       {
/* 131 */         if ("23000".equals(e.getSQLState()))
/*     */         {
/* 133 */           throw new DuplicateKeyException("Unique key violation or invalid foreign key value: pk=" + ctx.getId());
/*     */         }
/*     */
/* 137 */         throw new CreateException("Failed to create instance: pk=" + ctx.getId() + ", state=" + e.getSQLState() + ", msg=" + e.getMessage());
/*     */       }
/*     */
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

/*    */       }
/*    */       catch (SQLException e)
/*    */       {
/* 71 */         if ("23000".equals(e.getSQLState()))
/*    */         {
/* 73 */           throw new DuplicateKeyException("Unique key violation or invalid foreign key value: pk=" + ctx.getId());
/*    */         }
/*    */
/* 77 */         throw new CreateException("Failed to create instance: pk=" + ctx.getId() + ", state=" + e.getSQLState() + ", msg=" + e.getMessage());
/*    */       }
/*    */
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

/*     */     try
/*     */     {
/* 348 */       Object id = this.idField.get(ctx.getInstance());
/*     */
/* 351 */       if (getFile(id).exists()) {
/* 352 */         throw new DuplicateKeyException("Already exists: " + id);
/*     */       }
/*     */
/* 355 */       storeEntity(id, ctx.getInstance());
/*     */
/* 357 */       return id;
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

/*     */     try
/*     */     {
/* 243 */       Object id = this.idField.get(ctx.getInstance());
/*     */
/* 246 */       if (this.beans.containsKey(id)) {
/* 247 */         throw new DuplicateKeyException("Already exists: " + id);
/*     */       }
/*     */
/* 250 */       storeEntity(id, ctx.getInstance());
/*     */
/* 252 */       return id;
View Full Code Here

Examples of nexj.core.persistence.DuplicateKeyException

                  break;
               }
            }
         }

         return new DuplicateKeyException(firstInstance,
            (firstInstance == null) ? null :
            getUniqueKeys(getDuplicateKeyName(e),
            (RelationalMapping)firstInstance.getPersistenceMapping()), e);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.