Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.PersistenceBrokerException


            // 1.a if descriptor describes an interface: take PK fields from an implementors ClassDescriptor
            if (m_isInterface)
            {
                if (getExtentClasses().size() == 0)
                {
                    throw new PersistenceBrokerException(
                        "No Implementors declared for interface "
                            + this.getClassOfObject().getName());
                }
                Class implementor = (Class) getExtentClasses().get(0);
                ClassDescriptor implCld = this.getRepository().getDescriptorFor(implementor);
View Full Code Here


            }
            catch (Throwable t)
            {
                String msg = dynaBean.getClass().getName();
                logSetProblem(anObject, aValue, msg);
                throw new PersistenceBrokerException(t);
            }
        }
        else
        {
            String msg = "the object is not a DynaBean";
            logSetProblem(anObject, aValue, msg);
            throw new PersistenceBrokerException(msg);
        }
    }
View Full Code Here

            }
            catch (Throwable t)
            {
                String msg = dynaBean.getClass().getName();
                logGetProblem(anObject, msg);
                throw new PersistenceBrokerException(t);
            }
        }
        else
        {
            String msg = "the object is not a DynaBean";
            logGetProblem(anObject, msg);
            throw new PersistenceBrokerException(msg);
        }
    }
View Full Code Here

                {
                    initializationMethod.invoke(result, NO_ARGS);
                }
                catch (Exception ex)
                {
                    throw new PersistenceBrokerException("Unable to invoke initialization method:" + initializationMethod.getName() + " for class:" + m_cld.getClassOfObject(), ex);
                }
            }
        }
        return result;
    }
View Full Code Here

                row.put(fld.getColumnName(), fld.getFieldConversion().sqlToJava(val));
            }
        }
        catch (SQLException t)
        {
            throw new PersistenceBrokerException("Error reading class type: " + m_cld.getClassNameOfObject()
                    + " from result set, current read field was " + (fld != null ? fld.getPersistentField().getName() : null), t);
        }
    }
View Full Code Here

            try
            {
                String concreteClass = (String) row.get(concreteClassFD.getColumnName());
                if (concreteClass == null || concreteClass.trim().length() == 0)
                {
                    throw new PersistenceBrokerException(
                            "ojbConcreteClass field returned null or 0-length string");
                }
                else
                {
                    concreteClass = concreteClass.trim();
                }
                ClassDescriptor result = m_cld.getRepository().getDescriptorFor(concreteClass);
                if (result == null)
                {
                    LoggerFactory.getDefaultLogger().warn(
                            "[" + RowReaderDefaultImpl.class.getName()
                            + "] Can not find class-descriptor for ojbConcreteClass " + concreteClass
                            + ", use given class-descriptor '" + m_cld.getClassNameOfObject()
                            + "' instead");
                    result = m_cld;
                }
                return result;
            }
            catch (PBFactoryException e)
            {
                throw new PersistenceBrokerException(e);
            }
        }
    }
View Full Code Here

     */
    public static PBKey extractAllTokens(String name)
    {
        if(name == null)
        {
            throw new PersistenceBrokerException("Could not extract PBKey, given argument is 'null'");
        }
        String user = null;
        String passwd = null;
        StringTokenizer tok = new StringTokenizer(name, REPOSITORY_NAME_SEPARATOR);
        String dbName = tok.nextToken();
View Full Code Here

                result[i] = new ValueContainer(cv, fd.getJdbcType());
            }
        }
        catch(Exception e)
        {
            throw new PersistenceBrokerException("Can't generate primary key values for given Identity " + oid, e);
        }
        return result;
    }
View Full Code Here

            f.set(obj, result);
            return result;
        }
        catch(MetadataException e)
        {
            throw new PersistenceBrokerException(
                    "Error while trying to autoincrement field " + f.getDeclaringClass() + "#" + f.getName(),
                    e);
        }
        catch(SequenceManagerException e)
        {
            throw new PersistenceBrokerException("Could not get key value", e);
        }
    }
View Full Code Here

                count = rsStmt.m_rs.getInt(1);
            }
        }
        catch (SQLException e)
        {
            throw new PersistenceBrokerException(e);
        }
        finally
        {
            rsStmt.close();
        }
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.