/** * Make a (shallow) copy of query spaces to be synchronized * * @param synchronizedQuerySpaces The query spaces * * @return The copy */ public static Set<String> copy(Set<String> synchronizedQuerySpaces) { return CollectionHelper.makeCopy( synchronizedQuerySpaces ); }
/** * Make a (shallow) copy of the JPA query hints map * * @param hints The JPA query hints to copy * * @return The copy */ public static Map<String,Object> copy(Map<String, Object> hints) { return CollectionHelper.makeCopy( hints ); }
private <S extends J> Map<Class<S>, SubGraphImplementor<S>> makeMapCopy( boolean mutable, Map<Class<S>, SubGraphImplementor<S>> nodeMap) { if ( nodeMap == null ) { return null; } return CollectionHelper.makeCopy( nodeMap, type -> type, subGraph -> subGraph.makeCopy( mutable ) ); }
public synchronized void registerNamedProcedureCallMemento(String name, ProcedureCallMemento memento) { final Map<String, ProcedureCallMemento> copy = CollectionHelper.makeCopy( procedureCallMementoMap ); final ProcedureCallMemento previous = copy.put( name, memento ); if ( previous != null ) { log.debugf( "registering named procedure call definition [%s] overriding previously registered definition [%s]", name, previous ); } this.procedureCallMementoMap = Collections.unmodifiableMap( copy ); }
public synchronized void registerNamedQueryDefinition(String name, NamedQueryDefinition definition) { if ( NamedSQLQueryDefinition.class.isInstance( definition ) ) { throw new IllegalArgumentException( "NamedSQLQueryDefinition instance incorrectly passed to registerNamedQueryDefinition" ); } if ( ! name.equals( definition.getName() ) ) { definition = definition.makeCopy( name ); } final Map<String, NamedQueryDefinition> copy = CollectionHelper.makeCopy( namedQueryDefinitionMap ); final NamedQueryDefinition previous = copy.put( name, definition ); if ( previous != null ) { log.debugf( "registering named query definition [%s] overriding previously registered definition [%s]", name, previous ); } this.namedQueryDefinitionMap = Collections.unmodifiableMap( copy ); }
public synchronized void registerNamedSQLQueryDefinition(String name, NamedSQLQueryDefinition definition) { if ( ! name.equals( definition.getName() ) ) { definition = definition.makeCopy( name ); } final Map<String, NamedSQLQueryDefinition> copy = CollectionHelper.makeCopy( namedSqlQueryDefinitionMap ); final NamedQueryDefinition previous = copy.put( name, definition ); if ( previous != null ) { log.debugf( "registering named SQL query definition [%s] overriding previously registered definition [%s]", name, previous ); } this.namedSqlQueryDefinitionMap = Collections.unmodifiableMap( copy ); }
/** * Make a (shallow) copy of query spaces to be synchronized * * @param synchronizedQuerySpaces The query spaces * * @return The copy */ public static Set<String> copy(Set<String> synchronizedQuerySpaces) { return CollectionHelper.makeCopy( synchronizedQuerySpaces ); }
/** * Make a (shallow) copy of the JPA query hints map * * @param hints The JPA query hints to copy * * @return The copy */ public static Map<String,Object> copy(Map<String, Object> hints) { return CollectionHelper.makeCopy( hints ); }
private <S extends J> Map<Class<S>, SubGraphImplementor<S>> makeMapCopy( boolean mutable, Map<Class<S>, SubGraphImplementor<S>> nodeMap) { if ( nodeMap == null ) { return null; } return CollectionHelper.makeCopy( nodeMap, type -> type, subGraph -> subGraph.makeCopy( mutable ) ); }