protected void addSortedModificationsForType(Class<?> type, SortedSet<DbEntityOperation> preSortedOperations, List<DbOperation> flush) { if(preSortedOperations != null) { if(HasDbReferences.class.isAssignableFrom(type)) { // if this type has self references, we need to resolve the reference order flush.addAll(sortByReferences(preSortedOperations)); } else { flush.addAll(preSortedOperations); } } }
protected void addSortedModificationsForType(Class<?> type, SortedSet<DbEntityOperation> preSortedOperations, List<DbOperation> flush) { if(preSortedOperations != null) { if(HasDbReferences.class.isAssignableFrom(type)) { // if this type has self references, we need to resolve the reference order flush.addAll(sortByReferences(preSortedOperations)); } else { flush.addAll(preSortedOperations); } } }
/** Adds the insert operations to the flush (in correct order). * @param operationsForFlush */ protected void addSortedInserts(List<DbOperation> flush) { for (Entry<Class<?>, SortedSet<DbEntityOperation>> operationsForType : inserts.entrySet()) { // add inserts to flush if(HasDbReferences.class.isAssignableFrom(operationsForType.getKey())) { // if this type has self references, we need to resolve the reference order flush.addAll(sortByReferences(operationsForType.getValue())); } else { flush.addAll(operationsForType.getValue()); } } }
/** Adds the insert operations to the flush (in correct order). * @param operationsForFlush */ protected void addSortedInserts(List<DbOperation> flush) { for (Entry<Class<?>, SortedSet<DbEntityOperation>> operationsForType : inserts.entrySet()) { // add inserts to flush if(HasDbReferences.class.isAssignableFrom(operationsForType.getKey())) { // if this type has self references, we need to resolve the reference order flush.addAll(sortByReferences(operationsForType.getValue())); } else { flush.addAll(operationsForType.getValue()); } } }
protected void addSortedModificationsForType(Class<?> type, SortedSet<DbEntityOperation> preSortedOperations, List<DbOperation> flush) { if(preSortedOperations != null) { if(HasDbReferences.class.isAssignableFrom(type)) { // if this type has self references, we need to resolve the reference order flush.addAll(sortByReferences(preSortedOperations)); } else { flush.addAll(preSortedOperations); } } }
/** Adds the insert operations to the flush (in correct order). * @param operationsForFlush */ protected void addSortedInserts(List<DbOperation> flush) { for (Entry<Class<?>, SortedSet<DbEntityOperation>> operationsForType : inserts.entrySet()) { // add inserts to flush if(HasDbReferences.class.isAssignableFrom(operationsForType.getKey())) { // if this type has self references, we need to resolve the reference order flush.addAll(sortByReferences(operationsForType.getValue())); } else { flush.addAll(operationsForType.getValue()); } } }