Package org.datanucleus

Examples of org.datanucleus.StateManager.provideField()


                    // Ensure the current owner field is loaded, and replace with new key
                    if (ownerFieldNumber >= 0)
                    {
                        om.getApiAdapter().isLoaded(vsm, ownerFieldNumber);
                        Object oldOwner = vsm.provideField(ownerFieldNumber);
                        vsm.setObjectField(pcNewKey, ownerFieldNumber, oldOwner, newOwner);
                    }
                    else
                    {
                        updateKeyFk(sm, pcNewKey, newOwner);
View Full Code Here


                        updateKeyFk(sm, pcNewKey, newOwner);
                    }

                    // Ensure the current value field is loaded, and replace with new value
                    om.getApiAdapter().isLoaded(vsm, valueFieldNumber);
                    oldValue = vsm.provideField(valueFieldNumber); // TODO Should we update the local variable ?
                    vsm.setObjectField(pcNewKey, valueFieldNumber, oldValue, newValue);
                }
                else
                {
                    /*
 
View Full Code Here

            vsm.replaceField(keyFieldNumber, null, true);
           
            // Null the owner field
            if (ownerFieldNumber >= 0)
            {
                Object oldOwner = vsm.provideField(ownerFieldNumber);
                vsm.setObjectField(pcOldValue, ownerFieldNumber, oldOwner, null);
                vsm.replaceField(ownerFieldNumber, null, true);
            }
            else
            {
View Full Code Here

                {
                    // make sure the link to the owner is now set
                    AbstractMemberMetaData relatedMmd = mmd.getRelatedMemberMetaData(clr)[0];
                    if (sm.isFieldLoaded(relatedMmd.getAbsoluteFieldNumber()))
                    {
                        Object currentVal = sm.provideField(relatedMmd.getAbsoluteFieldNumber());
                        if (currentVal != ownerSM.getObject())
                        {
                            sm.replaceFieldValue(relatedMmd.getAbsoluteFieldNumber(), ownerSM.getObject());
                        }
                    }
View Full Code Here

                {
                    // make sure the link back to the owner is not still set
                    AbstractMemberMetaData relatedMmd = mmd.getRelatedMemberMetaData(clr)[0];
                    if (sm.isFieldLoaded(relatedMmd.getAbsoluteFieldNumber()))
                    {
                        Object currentVal = sm.provideField(relatedMmd.getAbsoluteFieldNumber());
                        if (currentVal == ownerSM.getObject())
                        {
                            sm.replaceFieldValue(relatedMmd.getAbsoluteFieldNumber(), null);
                        }
                    }
View Full Code Here

                    posMapping[j] = param[n++];
                }

                // Retrieve value of field from Embedded StateManager
                int embAbsFieldNum = embCmd.getAbsolutePositionOfMember(mapping.getMemberMetaData().getName());
                Object fieldValue = embSM.provideField(embAbsFieldNum);

                if (mapping instanceof EmbeddedPCMapping)
                {
                    mapping.setObject(om, ps, posMapping, fieldValue, embSM, embAbsFieldNum);
                }
View Full Code Here

          // with the value we ultimately want to return.
          // If we still have more tuples then that's an error.
          shouldBeDone = true;
        }
        AbstractMemberMetaData curMemberMetaData = typeMapping.getMemberMetaData();
        curValue = currentStateManager.provideField(curMemberMetaData.getAbsoluteFieldNumber());
        if (curValue == null) {
          // If we hit a null value we're done even if we haven't consumed
          // all the tuple fields
          break;
        }
View Full Code Here

        {
            if (relationType == Relation.ONE_TO_ONE_BI)
            {
                StateManager otherSM = sm.getObjectManager().findStateManager(pc);
                AbstractMemberMetaData relatedMmd = mmd.getRelatedMemberMetaDataForObject(clr, sm.getObject(), pc);
                Object relatedValue = otherSM.provideField(relatedMmd.getAbsoluteFieldNumber());
                if (relatedValue == null)
                {
                    // Managed Relations : Other side not set so update it in memory
                    if (NucleusLogger.PERSISTENCE.isDebugEnabled())
                    {
View Full Code Here

                // TODO Make sure we have this PC in the collection at the other side
                StateManager otherSM = sm.getObjectManager().findStateManager(pc);
                if (otherSM != null)
                {
                    // Managed Relations : add to the collection on the other side
                    Collection relatedColl = (Collection)otherSM.provideField(relatedMmds[0].getAbsoluteFieldNumber());
                    if (relatedColl != null && !(relatedColl instanceof SCOCollection))
                    {
                        // TODO Make sure the collection is a wrapper
                        boolean contained = relatedColl.contains(sm.getObject());
                        if (!contained)
View Full Code Here

                                // Only update the other side if not already being deleted
                                if (!om.getApiAdapter().isDeleted(otherSM.getObject()) && !otherSM.isDeleting())
                                {
                                    // Make sure the other object is updated in any caches
                                    om.markDirty(otherSM, false);
                                    Collection otherColl = (Collection)otherSM.provideField(relatedMmds[0].getAbsoluteFieldNumber());
                                    if (otherColl != null)
                                    {
                                        // TODO Localise this message
                                        NucleusLogger.JDO.debug("ManagedRelationships : delete of object causes removal from collection at " + relatedMmds[0].getFullFieldName());
                                        otherColl.remove(sm.getObject());
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.