Package org.apache.ojb.broker.metadata

Examples of org.apache.ojb.broker.metadata.MetadataException


        {
            ord = cld.getCollectionDescriptorByName(reference);
        }
        if(ord == null)
        {
            throw new MetadataException("Reference with name '" + reference + "' does not exist in " + clazz.getName());
        }
        ord.setCascadeRetrieve(autoretrieve);
        ord.setCascadingStore(autoupdate);
        ord.setCascadingDelete(autodelete);
        ord.setLazy(useProxy);
View Full Code Here


            // [tomdz] There seems to be no use of this setting ?
            //properties.put("valid", "false");
        }
        catch (Exception ex)
        {
            throw new MetadataException("An error happend while loading the properties file '"+filename+"'", ex);
        }
    }
View Full Code Here

    {
      ClassDescriptor cd = MetadataManager.getInstance().getRepository().getDescriptorFor(anObject.getClass());
            FieldDescriptor[] fields = cd.getPkFields();
            if(fields.length > 1 || fields.length == 0)
            {
                throw new MetadataException("ManageableHashMap can only be used for persistence capable objects with" +
                        " exactly one primiary key field defined in metadata, for " + anObject.getClass() + " the" +
                        " PK field count is " + fields.length);
            }
            else
            {
View Full Code Here

            {
                col = new RemovalAwareSet();
            }
            else
            {
                throw new MetadataException("Cannot determine a default collection type for collection "+desc.getAttributeName()+" in type "+desc.getClassDescriptor().getClassNameOfObject());
            }
        }
        else
        {
            try
View Full Code Here

            }
            this.applicationCache = (ObjectCacheInternal) temp;
        }
        catch(Exception e)
        {
            throw new MetadataException("Can't setup application cache. Specified application cache was '"
                    + applicationCacheName + "', copy strategy was '" + copyStrategyName + "'", e);
        }
        if(log.isEnabledFor(Logger.INFO))
        {
            ToStringBuilder buf = new ToStringBuilder(this);
View Full Code Here

            //          (instead of all active class-mappings).
            final Object key = mm.getCurrentProfileKey();
            if (key == null)
            {
                // mkalen:  Unsupported: using proxies with per-thread metadata changes without profile keys.
                throw new MetadataException("Trying to create a Collection proxy with per-thread metadata changes enabled, but no profile key.");
            }
            setProfileKey(key);
        }
        setBrokerKey(brokerKey);
        setCollectionClass(collClass);
View Full Code Here

            {
                _indirectionHandlerConstructor = getIndirectionHandlerClass().getConstructor(paramType);
            }
            catch(NoSuchMethodException ex)
            {
                throw new MetadataException("The class "
                        + _indirectionHandlerClass.getName()
                        + " specified for IndirectionHandlerClass"
                        + " is required to have a public constructor with signature ("
                        + PBKey.class.getName()
                        + ", "
View Full Code Here

        }
        if(indirectionHandlerClass.isInterface()
                || Modifier.isAbstract(indirectionHandlerClass.getModifiers())
                || !getIndirectionHandlerBaseClass().isAssignableFrom(indirectionHandlerClass))
        {
            throw new MetadataException("Illegal class "
                    + indirectionHandlerClass.getName()
                    + " specified for IndirectionHandlerClass. Must be a concrete subclass of "
                    + getIndirectionHandlerBaseClass().getName());
        }
        _indirectionHandlerClass = indirectionHandlerClass;
View Full Code Here

     */
    private static Constructor retrieveCollectionProxyConstructor(Class proxyClass, Class baseType, String typeDesc)
    {
        if(proxyClass == null)
        {
            throw new MetadataException("No " + typeDesc + " specified.");
        }
        if(proxyClass.isInterface() || Modifier.isAbstract(proxyClass.getModifiers()) || !baseType.isAssignableFrom(proxyClass))
        {
            throw new MetadataException("Illegal class "
                    + proxyClass.getName()
                    + " specified for "
                    + typeDesc
                    + ". Must be a concrete subclass of "
                    + baseType.getName());
        }

        Class[] paramType = {PBKey.class, Class.class, Query.class};

        try
        {
            return proxyClass.getConstructor(paramType);
        }
        catch(NoSuchMethodException ex)
        {
            throw new MetadataException("The class "
                    + proxyClass.getName()
                    + " specified for "
                    + typeDesc
                    + " is required to have a public constructor with signature ("
                    + PBKey.class.getName()
View Full Code Here

    {
        _collectionProxyConstructor = retrieveCollectionProxyConstructor(collectionProxyClass, Collection.class, "CollectionProxyClass");
        // we also require the class to be a subclass of ManageableCollection
        if(!ManageableCollection.class.isAssignableFrom(collectionProxyClass))
        {
            throw new MetadataException("Illegal class "
                    + collectionProxyClass.getName()
                    + " specified for CollectionProxyClass. Must be a concrete subclass of "
                    + ManageableCollection.class.getName());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.metadata.MetadataException

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.