Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.DataObjectAccessException


            } else {
                return null;
            }
        } catch (IllegalAccessException except) {
            // This should never happen
            throw new DataObjectAccessException(Messages.format(
                    "mapping.schemaChangeNoAccess", toString()), except);
        } catch (InvocationTargetException except) {
            // This should never happen
            throw new DataObjectAccessException(Messages.format("mapping.schemaChangeInvocation",
                                                              toString(), except), except);
        }
    }
View Full Code Here


                    + " on " + object.getClass().getName() + " with value " + value);
        }
       
        try {
            if (rf._addMethod == null) {
                throw new DataObjectAccessException(Messages.format(
                        "mapping.addMethodNotDefined", this.getName()));
            }

            if (value == null) {
                throw new NullPointerException("Adding null value is not allowed");
            }

            rf._addMethod.invoke(object, new Object[] {value});
        } catch (IllegalArgumentException e) {
            throw new DataObjectAccessException("Argument ," + value + ", cannot be added!", e);
        } catch (IllegalAccessException e) {
            throw new DataObjectAccessException("Field access error", e);
        } catch (InvocationTargetException e) {
            throw new DataObjectAccessException("Field invocation error", e);
        }
    }
View Full Code Here

                        rf._setMethod.invoke(internalObject,
                                new Object[] {(value == null) ? _default : value});
                    }
                }
            } else {
                throw new DataObjectAccessException(
                        "no method to set value for field: " + _fType + " in class: " + _eMold);
            }
            // If the field has no set method, ignore it.
            // If this is a problem, identity it someplace else.
        } catch (IllegalArgumentException except) {
            // Graceful way of dealing with unwrapping exception
            if (value == null) {
                throw new DataObjectAccessException(Messages.format(
                        "mapping.typeConversionNull", toString()));
            }
            throw new DataObjectAccessException(Messages.format(
                    "mapping.typeConversion", toString(), value.getClass().getName()));
        } catch (IllegalAccessException except) {
            // This should never happen
            throw new DataObjectAccessException(Messages.format(
                    "mapping.schemaChangeNoAccess", toString()), except);
        } catch (InvocationTargetException except) {
            // This should never happen
            throw new DataObjectAccessException(Messages.format(
                    "mapping.schemaChangeInvocation", toString(), except.getMessage()), except);
        }
    }
View Full Code Here

                    return rf._getMethod.invoke( object, null );
            } else
                return null;
        } catch ( IllegalAccessException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeNoAccess", toString() ), except );
        } catch ( InvocationTargetException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeInvocation",
                                                              toString(), except ) );
        }
    }
View Full Code Here

          _log.debug ("Calling " + rf._addMethod.getName() + " on " + object.getClass().getName() + " with value " + value);
        }
       
        try {
            if ( rf._addMethod == null )
                throw new DataObjectAccessException(Messages.format ("mapping.addMethodNotDefined", this.getName()));

            if ( value == null )
                throw new NullPointerException("Adding null value is not allowed");

            rf._addMethod.invoke( object, new Object[] { value } );
        } catch ( IllegalArgumentException e ) {
            throw new DataObjectAccessException("Argument ,"+value+", cannot be added!", e );
        } catch ( IllegalAccessException e ) {
            throw new DataObjectAccessException("Field access error", e );
        } catch ( InvocationTargetException e ) {
            throw new DataObjectAccessException("Field invocation error", e );
        }
    }
View Full Code Here

                        rf._deleteMethod.invoke( object, null );
                    else
                        rf._setMethod.invoke( object, new Object[] { value == null ? _default : value } );
                }
            } else {
                throw new DataObjectAccessException("no method to set value for field: "+_fType+" in class: "+_eMold);
            }
            // If the field has no set method, ignore it.
            // If this is a problem, identity it someplace else.
        } catch ( IllegalArgumentException except ) {
            // Graceful way of dealing with unwrapping exception
            if ( value == null )
                throw new DataObjectAccessException( Messages.format( "mapping.typeConversionNull", toString() ) );
            else
                throw new DataObjectAccessException( Messages.format( "mapping.typeConversion",
                                                            toString(), value.getClass().getName() ) );
        } catch ( IllegalAccessException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeNoAccess", toString() ), except );
        } catch ( InvocationTargetException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeInvocation",
                                                              toString(), except.getMessage() ), except );
        }
    }
View Full Code Here

                    return rf._getMethod.invoke( object, null );
            } else
                return null;
        } catch ( IllegalAccessException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeNoAccess", toString() ), except );
        } catch ( InvocationTargetException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeInvocation",
                                                              toString(), except ) );
        }
    }
View Full Code Here

    public void addValue( Object object, Object value, ClassLoader loader ) {

        ReflectService rf = getContextReflectService ( loader );
        try {
            if ( rf._addMethod == null )
                throw new DataObjectAccessException("No add method defined for this field");

            if ( value == null )
                throw new NullPointerException("Adding null value is not allowed");

            rf._addMethod.invoke( object, new Object[] { value } );
        } catch ( IllegalArgumentException e ) {
            throw new DataObjectAccessException("Argument ,"+value+", cannot be added!", e );
        } catch ( IllegalAccessException e ) {
            throw new DataObjectAccessException("Field access error", e );
        } catch ( InvocationTargetException e ) {
            throw new DataObjectAccessException("Field invocation error", e );
        }
    }
View Full Code Here

                        rf._deleteMethod.invoke( object, null );
                    else
                        rf._setMethod.invoke( object, new Object[] { value == null ? _default : value } );
                }
            } else {
                throw new DataObjectAccessException("no method to set value for field: "+_fType+" in class: "+_eMold);
            }
            // If the field has no set method, ignore it.
            // If this is a problem, identity it someplace else.
        } catch ( IllegalArgumentException except ) {
            // Graceful way of dealing with unwrapping exception
            if ( value == null )
                throw new DataObjectAccessException( Messages.format( "mapping.typeConversionNull", toString() ) );
            else
                throw new DataObjectAccessException( Messages.format( "mapping.typeConversion",
                                                            toString(), value.getClass().getName() ) );
        } catch ( IllegalAccessException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeNoAccess", toString() ), except );
        } catch ( InvocationTargetException except ) {
            // This should never happen
            throw new DataObjectAccessException( Messages.format( "mapping.schemaChangeInvocation",
                                                              toString(), except.getMessage() ), except );
        }
    }
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.DataObjectAccessException

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.