ExecutableList<QueuedOperationCollectionAction> init(ActionQueue instance) { return instance.collectionQueuedOps = new ExecutableList<QueuedOperationCollectionAction>( instance.isOrderUpdatesEnabled() ); } }
@SuppressWarnings("unchecked") private <T extends Executable & Comparable & Serializable> void addAction(Class<T> executableClass, T action) { EXECUTABLE_LISTS_MAP.get( executableClass ).getOrInit( this ).add( action ); }
public void clearFromFlushNeededCheck(int previousCollectionRemovalSize) { if( collectionCreations != null ) { collectionCreations.clear(); } if( collectionUpdates != null ) { collectionUpdates.clear(); } if( collectionQueuedOps != null ) { collectionQueuedOps.clear(); } if( updates != null) { updates.clear(); } // collection deletions are a special case since update() can add // deletions of collections not loaded by the session. if ( collectionRemovals != null && collectionRemovals.size() > previousCollectionRemovalSize ) { collectionRemovals.removeLastN( collectionRemovals.size() - previousCollectionRemovalSize ); } }
private static boolean areTablesToBeUpdated(ExecutableList<?> actions, @SuppressWarnings("rawtypes") Set tableSpaces) { if ( actions == null || actions.isEmpty() ) { return false; } for ( Serializable actionSpace : actions.getQuerySpaces() ) { if ( tableSpaces.contains( actionSpace ) ) { LOG.debugf( "Changes must be flushed to space: %s", actionSpace ); return true; } } return false; }
public void unScheduleDeletion(EntityEntry entry, Object rescuedEntity) { if ( rescuedEntity instanceof HibernateProxy ) { LazyInitializer initializer = ( (HibernateProxy) rescuedEntity ).getHibernateLazyInitializer(); if ( !initializer.isUninitialized() ) { rescuedEntity = initializer.getImplementation( session ); } } if( deletions != null ) { for ( int i = 0; i < deletions.size(); i++ ) { EntityDeleteAction action = deletions.get( i ); if (action.getInstance() == rescuedEntity) { deletions.remove( i ); return; } } } if( orphanRemovals != null ) { for ( int i = 0; i < orphanRemovals.size(); i++ ) { EntityDeleteAction action = orphanRemovals.get( i ); if (action.getInstance() == rescuedEntity) { orphanRemovals.remove( i ); return; } } } throw new AssertionFailure( "Unable to perform un-delete for instance " + entry.getEntityName() ); }
l = provider.init( rtn ); l.readExternal( ois ); LOG.tracev( "Deserialized [{0}] entries", l.size() ); l.afterDeserialize( session );
public boolean hasAnyQueuedActions() { return ( updates != null && !updates.isEmpty() ) || ( insertions != null && !insertions.isEmpty() ) || hasUnresolvedEntityInsertActions() || ( deletions != null && !deletions.isEmpty()) || ( collectionUpdates != null && !collectionUpdates.isEmpty() ) || ( collectionQueuedOps != null && !collectionQueuedOps.isEmpty() ) || ( collectionRemovals != null && !collectionRemovals.isEmpty() ) || ( collectionCreations != null && !collectionCreations.isEmpty() ); }
Set propertySpaces = list.getQuerySpaces(); invalidateSpaces( convertTimestampSpaces( propertySpaces ) ); list.clear(); session.getJdbcCoordinator().executeBatch();
public void clear() { for ( ListProvider listProvider : EXECUTABLE_LISTS_MAP.values() ) { ExecutableList<?> l = listProvider.get( this ); if( l != null ) { l.clear(); } } if( unresolvedInsertions != null ) { unresolvedInsertions.clear(); } }
public void unScheduleDeletion(EntityEntry entry, Object rescuedEntity) { if ( rescuedEntity instanceof HibernateProxy ) { LazyInitializer initializer = ( (HibernateProxy) rescuedEntity ).getHibernateLazyInitializer(); if ( !initializer.isUninitialized() ) { rescuedEntity = initializer.getImplementation( session ); } } if( deletions != null ) { for ( int i = 0; i < deletions.size(); i++ ) { EntityDeleteAction action = deletions.get( i ); if (action.getInstance() == rescuedEntity) { deletions.remove( i ); return; } } } if( orphanRemovals != null ) { for ( int i = 0; i < orphanRemovals.size(); i++ ) { EntityDeleteAction action = orphanRemovals.get( i ); if (action.getInstance() == rescuedEntity) { orphanRemovals.remove( i ); return; } } } throw new AssertionFailure( "Unable to perform un-delete for instance " + entry.getEntityName() ); }
l = provider.init( rtn ); l.readExternal( ois ); LOG.tracev( "Deserialized [{0}] entries", l.size() ); l.afterDeserialize( session );
private static boolean areTablesToBeUpdated(ExecutableList<?> actions, @SuppressWarnings("rawtypes") Set tableSpaces) { if ( actions == null || actions.isEmpty() ) { return false; } for ( Serializable actionSpace : actions.getQuerySpaces() ) { if ( tableSpaces.contains( actionSpace ) ) { LOG.debugf( "Changes must be flushed to space: %s", actionSpace ); return true; } } return false; }
/** * Check whether any insertion or deletion actions are currently queued. * * @return {@code true} if insertions or deletions are currently queued; {@code false} otherwise. */ public boolean areInsertionsOrDeletionsQueued() { return ( insertions != null && !insertions.isEmpty() ) || hasUnresolvedEntityInsertActions() || (deletions != null && !deletions.isEmpty()) || (orphanRemovals != null && !orphanRemovals.isEmpty()); }
Set<String> propertySpaces = list.getQuerySpaces(); invalidateSpaces( convertTimestampSpaces( propertySpaces ) ); list.clear(); session.getJdbcCoordinator().executeBatch();
public void clear() { for ( ListProvider listProvider : EXECUTABLE_LISTS_MAP.values() ) { ExecutableList<?> l = listProvider.get( this ); if( l != null ) { l.clear(); } } if( unresolvedInsertions != null ) { unresolvedInsertions.clear(); } }
public void clearFromFlushNeededCheck(int previousCollectionRemovalSize) { if( collectionCreations != null ) { collectionCreations.clear(); } if( collectionUpdates != null ) { collectionUpdates.clear(); } if( collectionQueuedOps != null ) { collectionQueuedOps.clear(); } if( updates != null) { updates.clear(); } // collection deletions are a special case since update() can add // deletions of collections not loaded by the session. if ( collectionRemovals != null && collectionRemovals.size() > previousCollectionRemovalSize ) { collectionRemovals.removeLastN( collectionRemovals.size() - previousCollectionRemovalSize ); } }
ExecutableList<EntityDeleteAction> init(ActionQueue instance) { // EntityDeleteAction executables never require sorting. return instance.deletions = new ExecutableList<EntityDeleteAction>( false ); } }
/** * Perform all currently queued entity-insertion actions. * * @throws HibernateException error executing queued insertion actions. */ public void executeInserts() throws HibernateException { if ( insertions != null && !insertions.isEmpty() ) { executeActions( insertions ); } }
@SuppressWarnings("unchecked") private <T extends Executable & Comparable & Serializable> void addAction(Class<T> executableClass, T action) { EXECUTABLE_LISTS_MAP.get( executableClass ).getOrInit( this ).add( action ); }
ExecutableList<EntityUpdateAction> init(ActionQueue instance) { return instance.updates = new ExecutableList<EntityUpdateAction>( instance.isOrderUpdatesEnabled() ); } }