Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.PersistenceBrokerException


    /** Checks length and compare order of field names with declared PK fields in metadata. */
    private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames)
    {
        if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length)
        {
            throw new PersistenceBrokerException("pkFieldName length does not match number of defined PK fields." +
                    " Expected number of PK fields is " + flds.length + ", given number was " +
                    (pkFieldNames != null ? pkFieldNames.length : 0));
        }
        boolean result = true;
        for(int i = 0; i < flds.length; i++)
View Full Code Here


                msg.append(eol).append("The root stack trace is --> ");
                String rootStack = ExceptionUtils.getStackTrace(rootCause);
                msg.append(eol).append(rootStack);
            }

            return new PersistenceBrokerException(msg.toString(), ex);
        }
        else
        {
            return new PersistenceBrokerException(msg.toString());
        }
    }
View Full Code Here

            itemCLD = (ClassDescriptor) extents.iterator().next();
        }
        FieldDescriptor[] itemClassPKFields = itemCLD.getPkFields();
        if(itemClassPKFields.length != fkColumns.length)
        {
            throw new PersistenceBrokerException("All pk fields of the element-class need to" +
                    " be declared in the indirection table. Element class is "
                    + itemCLD.getClassNameOfObject() + " with " + itemClassPKFields.length + " pk-fields." +
                    " Declared 'fk-pointing-to-element-class' elements in collection-descriptor are"
                    + fkColumns.length);
        }
View Full Code Here

            ValueContainer[] leftPkValues = pb.serviceBrokerHelper().getKeyValues(leftCld, leftObject);
            ValueContainer[] rightPkValues = pb.serviceBrokerHelper().getKeyValues(rightCld, rightObject);
            String[] pkLeftColumns = wanted.getFksToThisClass();
            String[] pkRightColumns = wanted.getFksToItemClass();
            String table = wanted.getIndirectionTable();
            if(table == null) throw new PersistenceBrokerException("Can't remove MtoN implementor without an indirection table");

            String stmt;
            String[] cols = mergeColumns(pkLeftColumns, pkRightColumns);
            ValueContainer[] values = mergeContainer(leftPkValues, rightPkValues);
            if(insert)
View Full Code Here

        {
            return result;
        }   
        else
        {
            throw new PersistenceBrokerException("loaded data does not implement java.util.Set");
        }
   
  }
View Full Code Here

        if (ord == null)
        {
            ord = anOwnerCld.getObjectReferenceDescriptorByName(aRelationshipName);
            if (ord == null)
            {
                throw new PersistenceBrokerException("Relationship named '" + aRelationshipName
                        + "' not found in owner class " + (anOwnerCld != null ? anOwnerCld.getClassNameOfObject() : null));
            }
        }
        return createRelationshipPrefetcher(ord);
    }  
View Full Code Here

      // Method m = subject.getClass().getMethod(method.getName(),
      // method.getParameterTypes());
      // return m.invoke(subject, args);
    } catch (Exception ex)
    {
      throw new PersistenceBrokerException("Error invoking method " + method.getName(), ex);
    }
  }
View Full Code Here

            "Can not materialize object for Identity " + _id + " - using PBKey " + getBrokerKey());
      }
      return realSubject;
    } catch (Exception ex)
    {
      throw new PersistenceBrokerException(ex);
    } finally
    {
      tmp.close();
    }
  }
View Full Code Here

        {
            return result;
        }
        else
        {
            throw new PersistenceBrokerException("loaded data does not implement java.util.List");
        }

    }
View Full Code Here

            {
                throw new PersistenceBrokerSQLException("Calling ResultSet.next() failed", (SQLException) ex);
            }
            else
            {
               throw new PersistenceBrokerException("Can't get next row from ResultSet", ex);
            }
        }
        if (logger.isDebugEnabled())
            logger.debug("hasNext() -> " + getHasNext());
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.PersistenceBrokerException

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.