Package org.jpox.exceptions

Examples of org.jpox.exceptions.JPOXException


            AnnotationObject[] annotations, ClassLoaderResolver clr)
    {
        if (pmd == null)
        {
            // TODO Localise this message
            throw new JPOXException("No PackageMetaData specified to use for annotations");
        }

        AbstractClassMetaData cmd = null;

        if (annotations != null && annotations.length > 0)
View Full Code Here


    public Object getNewSingleFieldIdentity(Class idType, Class pcType, Object value)
    {
        // TODO Use JPOX-internal SingleFieldIdentity
        if (idType == null)
        {
            throw new JPOXException(LOCALISER.msg("029001", pcType)).setFatal();
        }
        if (pcType == null)
        {
            throw new JPOXException(LOCALISER.msg("029000", idType)).setFatal();
        }
        if (value == null)
        {
            throw new JPOXException(LOCALISER.msg("029003", idType, pcType)).setFatal();
        }
        if (!SingleFieldIdentity.class.isAssignableFrom(idType))
        {
            throw new JPOXException(LOCALISER.msg("029002", idType.getName(), pcType.getName())).setFatal();
        }

        SingleFieldIdentity id = null;
        Class keyType = null;
        if (idType == LongIdentity.class)
        {
            keyType = Long.class;
            if (!(value instanceof Long))
            {
                throw new JPOXException(LOCALISER.msg("029004", idType.getName(),
                    pcType.getName(), value.getClass().getName(), "Long")).setFatal();
            }
        }
        else if (idType == IntIdentity.class)
        {
            keyType = Integer.class;
            if (!(value instanceof Integer))
            {
                throw new JPOXException(LOCALISER.msg("029004", idType.getName(),
                    pcType.getName(), value.getClass().getName(), "Integer")).setFatal();
            }
        }
        else if (idType == StringIdentity.class)
        {
            keyType = String.class;
            if (!(value instanceof String))
            {
                throw new JPOXException(LOCALISER.msg("029004", idType.getName(),
                    pcType.getName(), value.getClass().getName(), "String")).setFatal();
            }
        }
        else if (idType == ByteIdentity.class)
        {
            keyType = Byte.class;
            if (!(value instanceof Byte))
            {
                throw new JPOXException(LOCALISER.msg("029004", idType.getName(),
                    pcType.getName(), value.getClass().getName(), "Byte")).setFatal();
            }
        }
        else if (idType == ShortIdentity.class)
        {
            keyType = Short.class;
            if (!(value instanceof Short))
            {
                throw new JPOXException(LOCALISER.msg("029004", idType.getName(),
                    pcType.getName(), value.getClass().getName(), "Short")).setFatal();
            }
        }
        else if (idType == CharIdentity.class)
        {
            keyType = Character.class;
            if (!(value instanceof Character))
            {
                throw new JPOXException(LOCALISER.msg("029004", idType.getName(),
                    pcType.getName(), value.getClass().getName(), "Character")).setFatal();
            }
        }
        else
        {
View Full Code Here

                                apmd.addColumn(JPAAnnotationUtils.getColumnMetaDataForColumnAnnotation(apmd,
                                    new Member(overrideField), attributeOverride[j].column()));
                            }
                            catch (SecurityException e)
                            {
                                throw new JPOXException("Cannot obtain override field "+
                                    attributeOverride[j].name()+" of class "+member.getType()+
                                    " for persistent class "+cmd.getName(),e);
                            }
                            catch (NoSuchFieldException e)
                            {
                                throw new JPOXException("Override field "+attributeOverride[j].name()+
                                    " does not exist in class "+member.getType()+" for persistent class "+
                                    cmd.getName(),e);
                            }
                        }
                    }
View Full Code Here

     * @param clr the ClassLoaderResolver
     * @throws JPOXException
     */
    public void initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)
    {
        throw new JPOXException("subclass must override this method").setFatal();
    }
View Full Code Here

        {
            javaTypeMappings = new ArrayList();
        }
        if (mapping == null)
        {
            throw new JPOXException("mapping argument in EmbeddedMapping.addJavaTypeMapping is null").setFatal();
        }
        javaTypeMappings.add(mapping);
    }
View Full Code Here

        else
        {
            ApiAdapter api = om.getApiAdapter();
            if (!api.isPersistable(value))
            {
                throw new JPOXException(LOCALISER.msg("041016",
                    value.getClass(), value)).setFatal();
            }

            AbstractClassMetaData embCmd = om.getMetaDataManager().getMetaDataForClass(value.getClass().getName(), om.getClassLoaderResolver());
            StateManager embSM = om.findStateManager(value);
View Full Code Here

     * @param qrmd QueryResultMetaData
     * @since 1.2
     */
    public void setResultMetaData(QueryResultMetaData qrmd)
    {
        throw new JPOXException("This query doesn't support the use of setResultMetaData()");
    }
View Full Code Here

     */
    public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)
    {
        if (fmd == null || !containerIsStoredInSingleColumn())
        {
            throw new JPOXException(failureMessage("setObject")).setFatal();
        }

        StateManager[] sms = null;
        ApiAdapter api = om.getApiAdapter();
        if (value != null)
View Full Code Here

     */
    public Object getObject(ObjectManager om, Object resultSet, int[] exprIndex)
    {
        if (fmd == null || !containerIsStoredInSingleColumn())
        {
            throw new JPOXException(failureMessage("getObject")).setFatal();
        }
        return getDataStoreMapping(0).getObject(resultSet, exprIndex[0]);
    }
View Full Code Here

                currentIndex++;
            }
        }

        // TODO Localise this message
        throw new JPOXException("Invalid index " + index + " for DataStoreMapping.").setFatal();
    }
View Full Code Here

TOP

Related Classes of org.jpox.exceptions.JPOXException

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.