Package org.datanucleus

Examples of org.datanucleus.ClassLoaderResolver.classForName()


                return true;
            }
            else
            {
                String valueType = fmd.getMap().getValueType();
                Class valueCls = clr.classForName(valueType);
                if (valueCls != null && ClassUtils.isReferenceType(valueCls) &&
                    mgr.getMetaDataForImplementationOfReference(valueCls, null, clr) != null)
                {
                    // Map with values of reference type for FCOs
                    return true;
View Full Code Here


        ClassLoaderResolver clr = ec.getClassLoaderResolver();

        // Find the appropriate mapping
        for (int i=0; i<javaTypeMappings.length; i++)
        {
            Class cls = clr.classForName(javaTypeMappings[i].getType());
            if (cls.isAssignableFrom(value.getClass()))
            {
                return i;
            }
        }
View Full Code Here

        MetaDataManager mmgr = ec.getStoreManager().getNucleusContext().getMetaDataManager();
        boolean isPersistentInterface = mmgr.isPersistentInterface(getType());
        if (isPersistentInterface)
        {
            // Field is declared as a "persistent-interface" type so all impls of that type should match
            mappingJavaType = clr.classForName(getType());
        }
        else if (mmd != null && mmd.getFieldTypes() != null && mmd.getFieldTypes().length == 1)
        {
            isPersistentInterface = mmgr.isPersistentInterface(mmd.getFieldTypes()[0]);
            if (isPersistentInterface)
View Full Code Here

        {
            isPersistentInterface = mmgr.isPersistentInterface(mmd.getFieldTypes()[0]);
            if (isPersistentInterface)
            {
                // Field is declared as interface and accepts "persistent-interface" value, so all impls should match
                mappingJavaType = clr.classForName(mmd.getFieldTypes()[0]);
            }
        }
        if (mappingJavaType != null && mappingJavaType.isAssignableFrom(value.getClass()))
        {
            return -2; // Persistent interface persistable in all mappings. Should only be 1 anyway
View Full Code Here

        {
            Class pcClass;
            try
            {
                //load the class and make sure the class is initialized
                pcClass = clr.classForName(className, myID.getClass().getClassLoader(), true);
                cmd = myOM.getMetaDataManager().getMetaDataForClass(pcClass, clr);
            }
            catch (ClassNotResolvedException e)
            {
                NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("026014", myOM.getIdentityAsString(myID)));
View Full Code Here

                                thisMapping = null;
                                ReferenceMapping refMapping = (ReferenceMapping)expr.mapping;
                                JavaTypeMapping[] implMappings = refMapping.getJavaTypeMapping();
                                for (int i=0;i<implMappings.length;i++)
                                {
                                    Class implType = clr.classForName(implMappings[i].getType());
                                    if (implType.isAssignableFrom(value.getClass()))
                                    {
                                        thisMapping = implMappings[i];
                                        break;
                                    }
View Full Code Here

            {
                id = ec.getApiAdapter().getNewApplicationIdentityObjectId(clr, cmd, idStr);
            }
            else
            {
                Class cls = clr.classForName(cmd.getFullClassName());
                id = ec.newObjectId(cls, idStr);
            }
        }
        return ec.findObject(id, true, checkInheritance, null);
    }
View Full Code Here

            {
                // Decrypt the password using the provided class
                ClassLoaderResolver clr = nucleusContext.getClassLoaderResolver(null);
                try
                {
                    Class decrypterCls = clr.classForName(decrypterName);
                    ConnectionEncryptionProvider decrypter = (ConnectionEncryptionProvider) decrypterCls.newInstance();
                    password = decrypter.decrypt(password);
                }
                catch (Exception e)
                {
View Full Code Here

                case Relation.MANY_TO_ONE_BI :
                    final AbstractClassMetaData cmd = sm.getExecutionContext().getMetaDataManager().getMetaDataForClass(mmd.getType(), clr);
                    final NodeList nList = ((Element) node).getElementsByTagName(mmd.getName());
                    if (nList.getLength() == 1)
                    {
                        Object id = ec.getApiAdapter().getNewApplicationIdentityObjectId(clr.classForName(cmd.getFullClassName()), nList.item(0).getFirstChild().getNodeValue());
                        Object related = ec.findObject(id, true, true, null);
                        if (relationType == Relation.ONE_TO_ONE_BI)
                        {
                            // Set other side of relation to avoid reloading
                            ObjectProvider relatedSM = ec.findObjectProvider(related);
View Full Code Here

                                {
                                    throw new NucleusException("Unable to find object of type " + cmd2.getFullClassName() + " with id=" + nodeValue);
                                }

                                Object id = ec.getApiAdapter().getNewApplicationIdentityObjectId(
                                    clr.classForName(elementCmd.getFullClassName()), nodeValue);
                                Object related = ec.findObject(id, true, true, null);
                                if (relationType == Relation.ONE_TO_MANY_BI)
                                {
                                    // Set other side of relation to avoid reloading
                                    ObjectProvider relatedSM = ec.findObjectProvider(related);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.