Examples of usesVersionLocking()


Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        // Check early return to check if it is a new object, i.e. null primary key.
        Boolean doesExist = (Boolean)existQuery.checkEarlyReturn(clone, primaryKey, unitOfWork, null);
        if (doesExist == Boolean.FALSE) {
            //bug272704: throw an exception if this object is new yet has a version set to avoid merging in deleted objects
            if (descriptor.usesVersionLocking()){
                VersionLockingPolicy policy = (VersionLockingPolicy)descriptor.getOptimisticLockingPolicy();
                Object baseValue = policy.getBaseValue();
                Object objectLockValue = policy.getWriteLockValue(clone, primaryKey, unitOfWork);
                if ( policy.isNewerVersion(objectLockValue, baseValue) ) {
                    throw OptimisticLockException.objectChangedSinceLastMerge(clone);
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.