Package javax.jdo

Examples of javax.jdo.JDOException


        String assertionFailure, JDOException ex) {
        Throwable[] nesteds = ex.getNestedExceptions();
        int numberOfExceptions = nesteds==null ? 0 : nesteds.length;
        PersistenceManager[] result = new PersistenceManager[numberOfExceptions];
        for (int i = 0; i < numberOfExceptions; ++i) {
            JDOException exc = (JDOException)nesteds[i];
            Object failedObject = exc.getFailedObject();
            if (exc.getFailedObject() instanceof PersistenceManager) {
                result[i] = (PersistenceManager)failedObject;
            } else {
                throw new JDOFatalException(assertionFailure,
                     "Unexpected failed object of type: " +
                     failedObject.getClass().getName());
View Full Code Here


               for (int i = 0; i < length; ++i) {
                   Throwable t = ts[i];
                   if (t instanceof JDOOptimisticVerificationException) {
                       if (debug)
                           logger.debug("Expected exception caught " + t.toString());
                       JDOException jex = (JDOException)t;
                       Object failed = jex.getFailedObject();
                       if (failed == null) {
                           fail(ASSERTION_FAILED,
                                "Found unexpected null in failed object");
                       }
                       else {
View Full Code Here

            }
        } catch (JDOUserException e) {
            if (positive) {
                String msg = "JDOUserException thrown while executing query:\n" +
                        singleStringQuery;
                throw new JDOException(msg, e);
            }
        } catch (JDOException e) {
            String msg = "JDOException thrown while executing query:\n" +
                    singleStringQuery;
            throw new JDOException(msg, e);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
        }
View Full Code Here

        if ( constraint.getDeclaredParameters() != null )
        {
            if ( constraint.getParameters() == null )
            {
                throw new JDOException( "Unable to use query, there are declared parameters, "
                    + "but no parameter objects to use." );
            }

            if ( constraint.getParameters().length != constraint.getDeclaredParameters().length )
            {
                throw new JDOException( "Unable to use query, there are <" + constraint.getDeclaredParameters().length
                    + "> declared parameters, yet there are <" + constraint.getParameters().length
                    + "> parameter objects to use.  This should be equal." );
            }

            query.declareParameters( StringUtils.join( constraint.getDeclaredParameters(), ", " ) );
View Full Code Here

            if ( constraint.getDeclaredParameters() != null )
            {
                if ( constraint.getParameters() == null )
                {
                    throw new JDOException( "Unable to use query, there are declared parameters, "
                        + "but no parameter objects to use." );
                }

                if ( constraint.getParameters().length != constraint.getDeclaredParameters().length )
                {
                    throw new JDOException( "Unable to use query, there are <" + constraint.getDeclaredParameters().length
                        + "> declared parameters, yet there are <" + constraint.getParameters().length
                        + "> parameter objects to use.  This should be equal." );
                }

                query.declareParameters( StringUtils.join( constraint.getDeclaredParameters(), ", " ) );
View Full Code Here

                    return new JDOFatalInternalException(ne.getMessage(), ne);
                }
            }
            else if (ne.getNestedExceptions() != null)
            {
                return new JDOException(ne.getMessage(), ne.getNestedExceptions());
            }
            else
            {
                return new JDOException(ne.getMessage(), ne);
            }
        }
    }
View Full Code Here

            {
                nucleusContext.getMetaDataManager().loadPersistenceUnit(pumd, null);
            }
            catch (NucleusException jpe)
            {
                throw new JDOException(jpe.getMessage(),jpe);
            }
        }

        if (props != null)
        {
View Full Code Here

            Class qClass = ec.getClassLoaderResolver().classForName(qName);
            Method method = qClass.getMethod("candidate", new Class[] {});
            Object candObj = method.invoke(null, (Object[])null);
            if (candObj == null || !(candObj instanceof PersistableExpression))
            {
                throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
            }
            return (PersistableExpression)candObj;
        }
        catch (NoSuchMethodException nsfe)
        {
            throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
        }
        catch (InvocationTargetException ite)
        {
            throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
        }
        catch (IllegalAccessException iae)
        {
            throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
        }
    }
View Full Code Here

                Object candObj = ctr.newInstance(new Object[] {type, name, ExpressionType.PARAMETER});
                paramExpr = (ExpressionImpl)candObj;
            }
            catch (NoSuchMethodException nsme)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for parameters");
            }
            catch (IllegalAccessException iae)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for parameters");
            }
            catch (InvocationTargetException ite)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for parameters");
            }
            catch (InstantiationException ie)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for parameters");
            }
        }
        else
        {
            paramExpr = new ObjectExpressionImpl(type, name, ExpressionType.PARAMETER);
View Full Code Here

                Object candObj = ctr.newInstance(new Object[] {type, name, ExpressionType.VARIABLE});
                varExpr = (Expression)candObj;
            }
            catch (NoSuchMethodException nsme)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for variables");
            }
            catch (IllegalAccessException iae)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for variables");
            }
            catch (InvocationTargetException ite)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for variables");
            }
            catch (InstantiationException ie)
            {
                throw new JDOException("Class " + typeName + " has a Query class but has no constructor for variables");
            }
        }
        else if (type == Boolean.class || type == boolean.class)
        {
            varExpr = new BooleanExpressionImpl(type, name, ExpressionType.VARIABLE);
View Full Code Here

TOP

Related Classes of javax.jdo.JDOException

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.