Package org.datanucleus.store.mapped.mapping

Examples of org.datanucleus.store.mapped.mapping.InterfaceMapping


        if (fieldMapping != null)
        {
            if (fieldMapping instanceof InterfaceMapping)
            {
                // 1-1 Interface field
                InterfaceMapping intfMapping = (InterfaceMapping)fieldMapping;
                if (mmd != null)
                {
                    if (mmd.getFieldTypes() != null || mmd.hasExtension("implementation-classes"))
                    {
                        // Field is defined to not accept this type so just return
                        return;
                    }
                }

                processInterfaceMappingForValue(intfMapping, value, mmd, ec);
            }
            else if (mmd.hasCollection())
            {
                boolean hasJoin = false;
                if (mmd.getJoinMetaData() != null)
                {
                    hasJoin = true;
                }
                else
                {
                    AbstractMemberMetaData[] relMmds = mmd.getRelatedMemberMetaData(clr);
                    if (relMmds != null && relMmds[0].getJoinMetaData() != null)
                    {
                        hasJoin = true;
                    }
                }
                if (!hasJoin)
                {
                    // Not join table so no supported schema updates
                    return;
                }

                Collection coll = (Collection)value;
                if (coll == null || coll.isEmpty())
                {
                    return;
                }

                DatastoreContainerObject joinTbl = ((RDBMSStoreManager)ec.getStoreManager()).getDatastoreContainerObject(mmd);
                CollectionTable collTbl = (CollectionTable)joinTbl;
                JavaTypeMapping elemMapping = collTbl.getElementMapping();
                if (elemMapping instanceof InterfaceMapping)
                {
                    InterfaceMapping intfMapping = (InterfaceMapping)elemMapping;
                    processInterfaceMappingForValue(intfMapping, coll.iterator().next(), mmd, ec);
                }
            }
            else if (mmd.hasMap())
            {
View Full Code Here

TOP

Related Classes of org.datanucleus.store.mapped.mapping.InterfaceMapping

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.