Package javax.jdo

Examples of javax.jdo.JDOUserException


            parser.declareParameters();
            return treeParser.declareParameters(parser.getAST());
        }
        catch (RecognitionException ex)
        {
            throw new JDOUserException("Error in parameter declaration at line "+ex.getLine()+", column "+ex.getColumn());
        }
        catch (TokenStreamException ex)
        {
            throw new JDOUserException("Could not parse the parameter declaration");
        }
    }
View Full Code Here


            parser.declareVariables();
            return treeParser.declareVariables(parser.getAST());
        }
        catch (RecognitionException ex)
        {
            throw new JDOUserException("Error in variable declaration at line "+ex.getLine()+", column "+ex.getColumn());
        }
        catch (TokenStreamException ex)
        {
            throw new JDOUserException("Could not parse the variable declaration");
        }
    }
View Full Code Here

            parser.declareImports();
            return treeParser.declareImports(parser.getAST());
        }
        catch (RecognitionException ex)
        {
            throw new JDOUserException("Error in import specification at line "+ex.getLine()+", column "+ex.getColumn());
        }
        catch (TokenStreamException ex)
        {
            throw new JDOUserException("Could not parse the import specification");
        }
    }
View Full Code Here

            parser.setOrdering();
            return treeParser.setOrdering(parser.getAST());
        }
        catch (RecognitionException ex)
        {
            throw new JDOUserException("Error in ordering specification at line "+ex.getLine()+", column "+ex.getColumn());
        }
        catch (TokenStreamException ex)
        {
            throw new JDOUserException("Could not parse the ordering specification");
        }
    }
View Full Code Here

            parser.expression();
            return treeParser.expression(parser.getAST());
        }
        catch (RecognitionException ex)
        {
            throw new JDOUserException("Error in filter expression at line "+ex.getLine()+", column "+ex.getColumn());
        }
        catch (TokenStreamException ex)
        {
            throw new JDOUserException("Could not parse the filter expression");
        }
    }
View Full Code Here

        String className = null;
        if (param instanceof String) {
            /* The paramString is of the form "<className>:<keyString>" */
            paramString = (String)param;
            if (paramString.length() < 3) {
                throw new JDOUserException(
                    msg.msg("EXC_ObjectIdentityStringConstructionTooShort") + //NOI18N
                    msg.msg("EXC_ObjectIdentityStringConstructionUsage", //NOI18N
                        paramString));
            }
            int indexOfDelimiter = paramString.indexOf(STRING_DELIMITER);
            if (indexOfDelimiter < 0) {
                throw new JDOUserException(
                    msg.msg("EXC_ObjectIdentityStringConstructionNoDelimiter") + //NOI18N
                    msg.msg("EXC_ObjectIdentityStringConstructionUsage", //NOI18N
                        paramString));
            }
            keyString = paramString.substring(indexOfDelimiter+1);
View Full Code Here

                    new Class[] {String.class}, new Object[] {ne.getMessage()});
            }
            catch (NucleusException ne2)
            {
                // No JDOReadOnlyException so JDO1.0-JDO2.1
                throw new JDOUserException(ne2.getMessage());
            }
        }
        else if (ne instanceof NucleusDataStoreException)
        {
            if (ne.isFatal())
            {
                //sadly JDOFatalDataStoreException dont allow nested exceptions and failed objects together
                if (ne.getFailedObject() != null)
                {
                    return new JDOFatalDataStoreException(ne.getMessage(), ne.getFailedObject());
                }
                else if (ne.getNestedExceptions() != null)
                {
                    return new JDOFatalDataStoreException(ne.getMessage(), ne.getNestedExceptions());
                }
                else
                {
                    return new JDOFatalDataStoreException(ne.getMessage(), ne);
                }
            }
            else
            {
                if (ne.getNestedExceptions() != null)
                {
                    if (ne.getFailedObject() != null)
                    {
                        return new JDODataStoreException(ne.getMessage(), ne.getNestedExceptions(), ne.getFailedObject());
                    }
                    return new JDODataStoreException(ne.getMessage(), ne.getNestedExceptions());
                }
                else if (ne.getFailedObject() != null)
                {
                    JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                    return new JDODataStoreException(ne.getMessage(), ne.getFailedObject());
                }
                else
                {
                    JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                    return new JDODataStoreException(ne.getMessage(), ne);
                }
            }
        }
        else if (ne instanceof NucleusObjectNotFoundException)
        {
            if (ne.getFailedObject() != null)
            {
                if (ne.getNestedExceptions() != null)
                {
                    return new JDOObjectNotFoundException(ne.getMessage(), ne.getNestedExceptions(), ne.getFailedObject());
                }
                else
                {
                    return new JDOObjectNotFoundException(ne.getMessage(), ne, ne.getFailedObject());
                }
            }
            else if (ne.getNestedExceptions() != null)
            {
                return new JDOObjectNotFoundException(ne.getMessage(), ne.getNestedExceptions());
            }
            else
            {
                return new JDOObjectNotFoundException(ne.getMessage(), new Throwable[]{ne});
            }
        }
        else if (ne instanceof NucleusCanRetryException)
        {
            if (ne.getNestedExceptions() != null)
            {
                if (ne.getFailedObject() != null)
                {
                    return new JDOCanRetryException(ne.getMessage(), ne.getNestedExceptions(), ne.getFailedObject());
                }
                return new JDOCanRetryException(ne.getMessage(), ne.getNestedExceptions());
            }
            else if (ne.getFailedObject() != null)
            {
                JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                return new JDOCanRetryException(ne.getMessage(), ne.getFailedObject());
            }
            else
            {
                JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                return new JDOCanRetryException(ne.getMessage(), ne);
            }
        }
        else if (ne instanceof NucleusUserException)
        {
            if (ne.isFatal())
            {
                if (ne.getNestedExceptions() != null)
                {
                    if (ne.getFailedObject() != null)
                    {
                        return new JDOFatalUserException(ne.getMessage(), ne.getNestedExceptions(), ne.getFailedObject());
                    }
                    return new JDOFatalUserException(ne.getMessage(), ne.getNestedExceptions());
                }
                else if (ne.getFailedObject() != null)
                {
                    JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                    return new JDOFatalUserException(ne.getMessage(), ne.getFailedObject());
                }
                else
                {
                    JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                    return new JDOFatalUserException(ne.getMessage(), ne);
                }
            }
            else
            {
                if (ne.getNestedExceptions() != null)
                {
                    if (ne.getFailedObject() != null)
                    {
                        return new JDOUserException(ne.getMessage(), ne.getNestedExceptions(), ne.getFailedObject());
                    }
                    return new JDOUserException(ne.getMessage(), ne.getNestedExceptions());
                }
                else if (ne.getFailedObject() != null)
                {
                    JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                    return new JDOUserException(ne.getMessage(), ne.getFailedObject());
                }
                else
                {
                    JDOPersistenceManager.LOGGER.info("Exception thrown", ne);
                    return new JDOUserException(ne.getMessage(), ne);
                }
            }
        }
        else if (ne instanceof NucleusOptimisticException)
        {
View Full Code Here

     * @param e The cause
     * @return The JDO exception
     */
    public RuntimeException getUserExceptionForException(String msg, Exception e)
    {
        return new JDOUserException(msg, e);
    }
View Full Code Here

            // Close the ObjectManager
            om.close();
        }
        catch (TransactionActiveOnCloseException tae)
        {
            throw new JDOUserException(tae.getMessage(), this);
        }
        catch (NucleusException ne)
        {
            throw NucleusJDOHelper.getJDOExceptionForNucleusException(ne);
        }
View Full Code Here

                failures.add(e);
            }
        }
        if (!failures.isEmpty())
        {
            throw new JDOUserException(LOCALISER.msg("010036"), (Exception[]) failures.toArray(new Exception[failures.size()]));
        }
    }
View Full Code Here

TOP

Related Classes of javax.jdo.JDOUserException

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.