Examples of provideField()


Examples of org.datanucleus.StateManager.provideField()

        // don't want to associate the state manager with the parameter value is
        // that this would be a very surprising (and meaningful) side effect.
        StateManager sm = apiAdapter.newStateManager(getObjectManager(), acmd);
        sm.initialiseForHollow(null, null, value.getClass());
        sm.copyFieldsFromObject((PersistenceCapable) value, acmd.getPKMemberPositions());
        jdoPrimaryKey = sm.provideField(acmd.getPKMemberPositions()[0]);
      }
      if (jdoPrimaryKey == null) {
        throw new FatalNucleusUserException(
            query.getSingleStringQuery() + ": Parameter value " + value
            + " does not have an id.");
View Full Code Here

Examples of org.datanucleus.state.ObjectProvider.provideField()

      // TODO This is really "ManagedRelationships" so needs to go in RelationshipManager
      ObjectProvider elementOP = ec.findObjectProvider(element);
      if (relationType == RelationType.ONE_TO_MANY_BI) {
        // Managed Relations : 1-N bidir, so update the owner of the element
        elementOP.isLoaded(getFieldNumberInElementForBidirectional(elementOP)); // Ensure is loaded
        Object oldOwner = elementOP.provideField(getFieldNumberInElementForBidirectional(elementOP));
        if (oldOwner != newOwner) {
          if (NucleusLogger.PERSISTENCE.isDebugEnabled()) {
            NucleusLogger.PERSISTENCE.debug(LOCALISER.msg("055009", StringUtils.toJVMIDString(op.getObject()),
                ownerMemberMetaData.getFullFieldName(), StringUtils.toJVMIDString(element)));
          }
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

                    // Version stored in a normal field
                    int versionFieldNumber = acmd.getMetaDataForMember(vermd.getFieldName()).getAbsoluteFieldNumber();
                    if (stmtMapping.getMappingForMemberPosition(versionFieldNumber) != null)
                    {
                        ObjectProvider objSM = ec.findObjectProvider(obj);
                        Object verFieldValue = objSM.provideField(versionFieldNumber);
                        if (verFieldValue != null)
                        {
                            objSM.setVersion(verFieldValue);
                        }
                    }
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

                AbstractClassMetaData paramCmd = ec.getMetaDataManager().getMetaDataForClass(obj.getClass(), clr);
                AbstractMemberMetaData paramFieldMmd = paramCmd.getMetaDataForMember(fieldName);
                if (paramSM != null)
                {
                    ec.getApiAdapter().isLoaded(paramSM, paramFieldMmd.getAbsoluteFieldNumber());
                    paramFieldValue = paramSM.provideField(paramFieldMmd.getAbsoluteFieldNumber());
                }
                else
                {
                    paramFieldValue = ClassUtils.getValueOfFieldByReflection(obj, fieldName);
                }
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

    private boolean elementAlreadyContainsOwnerInMtoN(ObjectProvider ownerSM, Object element)
    {
        ExecutionContext ec = ownerSM.getExecutionContext();
        ObjectProvider elementSM = ec.findObjectProvider(element);
        AbstractMemberMetaData[] relatedMmds = ownerMemberMetaData.getRelatedMemberMetaData(ec.getClassLoaderResolver());
        Object elementSCO = elementSM.provideField(relatedMmds[0].getAbsoluteFieldNumber());
        if (elementSCO instanceof SCOMtoN)
        {
            // The field is already a SCO wrapper so just query it
            if (contains(ownerSM, element))
            {
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

            // Managed Relations : make sure we have consistency of relation
            ObjectProvider elementSM = sm.getExecutionContext().findObjectProvider(element);
            if (elementSM != null)
            {
                AbstractMemberMetaData[] relatedMmds = ownerMemberMetaData.getRelatedMemberMetaData(clr);
                Object elementOwner = elementSM.provideField(relatedMmds[0].getAbsoluteFieldNumber());
                if (elementOwner == null)
                {
                    // No owner, so correct it
                    NucleusLogger.PERSISTENCE.info(LOCALISER.msg("056037", sm.toPrintableID(), ownerMemberMetaData
                            .getFullFieldName(), StringUtils.toJVMIDString(elementSM.getObject())));
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

                // Managed Relations : make sure we have consistency of relation
                ObjectProvider elementSM = sm.getExecutionContext().findObjectProvider(element);
                if (elementSM != null)
                {
                    AbstractMemberMetaData[] relatedMmds = ownerMemberMetaData.getRelatedMemberMetaData(clr);
                    Object elementOwner = elementSM.provideField(relatedMmds[0].getAbsoluteFieldNumber());
                    if (elementOwner == null)
                    {
                        // No owner, so correct it
                        NucleusLogger.PERSISTENCE.info(LOCALISER.msg("056037", sm.toPrintableID(), ownerMemberMetaData
                                .getFullFieldName(), StringUtils.toJVMIDString(elementSM.getObject())));
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

            ObjectProvider elementSM = ec.findObjectProvider(element);
            if (getFieldNumberInElementForBidirectional(elementSM) >= 0)
            {
                // Managed Relations : 1-N bidir, so update the owner of the element
                ec.getApiAdapter().isLoaded(elementSM, getFieldNumberInElementForBidirectional(elementSM)); // Ensure is loaded
                Object oldOwner = elementSM.provideField(getFieldNumberInElementForBidirectional(elementSM));
                if (oldOwner != newOwner)
                {
                    if (NucleusLogger.PERSISTENCE.isDebugEnabled())
                    {
                        NucleusLogger.PERSISTENCE.debug(LOCALISER.msg("055009", sm.toPrintableID(),
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

        {
            if (!ec.getApiAdapter().isDeleted(elementToRemove))
            {
                // Find the existing owner if the record hasn't already been deleted
                ec.getApiAdapter().isLoaded(elementSM, ownerFieldNumber);
                oldOwner = elementSM.provideField(ownerFieldNumber);
            }
        }
        else
        {
            // TODO Check if the element is managed by a different owner now
View Full Code Here

Examples of org.datanucleus.store.ObjectProvider.provideField()

                            ownerMemberMetaData.getFullFieldName(),
                            StringUtils.toJVMIDString(element)));
                    }

                    int relatedFieldNumber = getFieldNumberInElementForBidirectional(elementSM);
                    Object currentValue = elementSM.provideField(relatedFieldNumber);
                    if (currentValue != null)
                    {
                        elementSM.replaceFieldMakeDirty(relatedFieldNumber, null);
                        if (ec.isFlushing())
                        {
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.