/** * Force instantiation to any eager mappings. */ public void instantiateEagerMappings(Object object, AbstractSession session) { // Force instantiation to eager mappings. if (!this.eagerMappings.isEmpty()) { FetchGroup fetchGroup = null; FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { fetchGroup = fetchGroupManager.getObjectFetchGroup(object); } int size = this.eagerMappings.size(); for (int index = 0; index < size; index++) { DatabaseMapping mapping = this.eagerMappings.get(index); if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { mapping.instantiateAttribute(object, session); } } } }
/** * Force instantiation to any eager mappings. */ public void instantiateEagerMappings(Object object, AbstractSession session) { // Force instantiation to eager mappings. if (!this.eagerMappings.isEmpty()) { FetchGroup fetchGroup = null; FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { fetchGroup = fetchGroupManager.getObjectFetchGroup(object); } int size = this.eagerMappings.size(); for (int index = 0; index < size; index++) { DatabaseMapping mapping = this.eagerMappings.get(index); if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { mapping.instantiateAttribute(object, session); } } } }
/** * INTERNAL: * Determines whether the query should use optimistic locking with the passed object. */ protected boolean shouldUseOptimisticLocking(Object object) { if (this.descriptor.usesOptimisticLocking()) { if (object != null) { FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { FetchGroup fetchGroup = fetchGroupManager.getObjectFetchGroup(object); if (fetchGroup == fetchGroupManager.getIdEntityFetchGroup()) { return false; } } } return true; } else { return false; } }
/** * INTERNAL: * Determines whether the query should use optimistic locking with the passed object. */ protected boolean shouldUseOptimisticLocking(Object object) { if (this.descriptor.usesOptimisticLocking()) { if (object != null) { FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { FetchGroup fetchGroup = fetchGroupManager.getObjectFetchGroup(object); if (fetchGroup == fetchGroupManager.getIdEntityFetchGroup()) { return false; } } } return true; } else { return false; } }
/** * INTERNAL: * Ensure the change set is populated for cache coordination. */ public void ensureChanges() { if (this.isNew && ((this.changes == null) || this.changes.isEmpty())) { AbstractSession unitOfWork = this.unitOfWorkChangeSet.getSession(); // Full change set is only required for cache coordination, not remote. if (!unitOfWork.isRemoteUnitOfWork()) { ClassDescriptor descriptor = getDescriptor(); if ((unitOfWork != null) && (descriptor != null)) { FetchGroup fetchGroup = null; if(descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(this.cloneObject); } List mappings = descriptor.getMappings(); int mappingsSize = mappings.size(); for (int index = 0; index < mappingsSize; index++) { DatabaseMapping mapping = (DatabaseMapping)mappings.get(index); if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { addChange(mapping.compareForChange(this.cloneObject, this.cloneObject, this, unitOfWork)); } } } } } }
/** * Ensure the change set is populated for cache coordination. * * @param session current database session * @param changeSet change set to populate * @param descriptor class (relational) descriptor related to the change set */ private void ensureChanges(final AbstractSession session, final ObjectChangeSet changeSet, final ClassDescriptor descriptor) { FetchGroup fetchGroup = null; if (descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(changeSet.cloneObject); } for (DatabaseMapping mapping : descriptor.getMappings()) { if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { changeSet.addChange(mapping.compareForChange(changeSet.cloneObject, changeSet.cloneObject, changeSet, session)); } } }
if ((descriptor.usesOptimisticLocking()) && (changes.getId() != null)) { if (descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(clone); int mappingsSize = mappings.size(); if(shouldGetFetchGroup && descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(clone);
if ((descriptor.usesOptimisticLocking()) && (changes.getId() != null)) { if (descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(clone); int mappingsSize = mappings.size(); if(shouldGetFetchGroup && descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(clone);
FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if(fetchGroupManager != null) { fetchGroup = fetchGroupManager.getObjectFetchGroup(this.cloneObject);
FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { FetchGroup fetchGroup = fetchGroupManager.getObjectFetchGroup(object); if (fetchGroup != null) { if (!fetchGroup.getAttributeNames().containsAll(group.getAttributeNames())) {
FetchGroup sourceFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(source); FetchGroup targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) {
FetchGroup sourceFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(source); FetchGroup targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) {
FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if(fetchGroupManager != null) { fetchGroup = fetchGroupManager.getObjectFetchGroup(this.cloneObject);
FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { FetchGroup fetchGroup = fetchGroupManager.getObjectFetchGroup(object); if (fetchGroup != null) { if (!fetchGroup.getAttributeNames().containsAll(group.getAttributeNames())) {
FetchGroup targetFetchGroup = null; if(this.descriptor.hasFetchGroupManager()) { sourceFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(source); targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) {
FetchGroup targetFetchGroup = null; if(this.descriptor.hasFetchGroupManager()) { sourceFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(source); targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) {
FetchGroup fetchGroup = null; if(descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(clone);
FetchGroup fetchGroup = null; if(descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(clone);
FetchGroup fetchGroup = getCurrentDescriptor().getFetchGroupManager().getObjectFetchGroup(sourceObject); if (fetchGroup != null) { List<DatabaseMapping> fetchGroupMappings = new ArrayList();
FetchGroup fetchGroup = getCurrentDescriptor().getFetchGroupManager().getObjectFetchGroup(sourceObject); if (fetchGroup != null) { List<DatabaseMapping> fetchGroupMappings = new ArrayList();