Package javax.persistence

Examples of javax.persistence.PersistenceException


        }
      }

      return statements;
    } catch (IOException e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here


                return rowCount;
              
            }

        } catch (SQLException ex) {
            throw new PersistenceException(ex);

        } finally {
            if (!batchThisRequest && pstmt != null) {
                try {
                  pstmt.close();
View Full Code Here

      case DEFAULT_ONIFEMPTY:
        return query.isDetailEmpty();

      default:
        throw new PersistenceException("Invalid autoFetchMode " + mode);
      }
    }
  }
View Full Code Here

    if (matches == null) {
      String m = "Matches for the concatinated key columns where not found?"
          + " I expect that the concatinated key was null, and this bean does"
          + " not have ManyToOne assoc beans matching the primary key columns?";
      throw new PersistenceException(m);
    }

    EntityBean bean = persist.getEntityBean();

    // populate it from the assoc one id values...
View Full Code Here

      if (rset.next()) {
        int val = rset.getInt(1);
        return Integer.valueOf(val);
      } else {
        String m = "Always expecting 1 row from " + sql;
        throw new PersistenceException(m);
      }
    } catch (SQLException e) {
      throw new PersistenceException("Error getting sequence nextval", e);

    } finally {
      if (useTxnConnection) {
        closeResources(rset, pstmt, null);
      } else {
View Full Code Here

      } else {
        this.constructor = defaultConstructor(clazz);
      }
     
    } catch (Exception e) {
      throw new PersistenceException(e);
    }
  }
View Full Code Here

            }

        } catch (SQLException ex) {
          SpiUpdate<?> ormUpdate = request.getOrmUpdate();
          String msg = "Error executing: "+ormUpdate.getGeneratedSql();
            throw new PersistenceException(msg, ex);

        } finally {
            if (!batchThisRequest && pstmt != null) {
                try {
                  pstmt.close();
View Full Code Here

    stmtMap.clear();
    maxSize = 0;

    if (firstError != null) {
      String msg = "Error when batch flush on sql: "+errorSql;
      throw new PersistenceException(msg, firstError);
    }
  }
View Full Code Here

        // invoke sendBatch();
      rows = ((Integer) METHOD_SEND_BATCH.invoke(pstmtDelegate.unwrap(pstmt))).intValue();
   
    } catch (IllegalAccessException e) {
            String msg = "Error invoking Oracle sendBatch method via reflection";
      throw new PersistenceException(msg,e);
   
    } catch (InvocationTargetException e) {
        String msg = "Error invoking Oracle sendBatch method via reflection";
      throw new PersistenceException(msg, e);
    }
    if (occCheck && rows != expectedRows) {
        String msg = "Batch execution expected "+expectedRows+" but got "+rows+"  sql:"+sql;
      throw new OptimisticLockException(msg);
    }
View Full Code Here

      ScalarType<?> type = typeManager.getScalarType(value.getClass());
      if (type == null){
        // the type is not registered with the TypeManager.
        String msg = "No ScalarType registered for "+value.getClass();
        throw new PersistenceException(msg);
       
      } else if (!type.isJdbcNative()) {
        // convert to a JDBC native type
        value = type.toJdbcType(value);
      }
View Full Code Here

TOP

Related Classes of javax.persistence.PersistenceException

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.