@@ -0,0 +1,3226 @@
+/**%0A *%0A * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); You may not%0A * use this file except in compliance with the License. You may obtain a copy of%0A * the License at:%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations under%0A * the License.%0A */%0Apackage com.speedment.runtime.core.manager;%0A%0Aimport com.speedment.common.injector.State;%0Aimport com.speedment.common.injector.annotation.ExecuteBefore;%0Aimport com.speedment.common.injector.annotation.Inject;%0Aimport com.speedment.common.injector.annotation.WithState;%0Aimport com.speedment.runtime.core.component.ManagerComponent;%0Aimport com.speedment.runtime.core.component.ProjectComponent;%0Aimport com.speedment.runtime.core.component.StreamSupplierComponent;%0Aimport com.speedment.runtime.core.stream.parallel.ParallelStrategy;%0A%0Aimport java.util.stream.Stream;%0A%0Aimport static com.speedment.common.injector.State.INITIALIZED;%0Aimport static java.lang.String.format;%0Aimport static java.util.Objects.requireNonNull;%0A%0A/**%0A * Abstract base class for VIEW Tables.%0A *%0A * @param %3CENTITY%3E  the entity type%0A *%0A * @author Emil Forslund%0A * @since  3.0.10%0A *%0A * @see AbstractManager%0A */%0Apublic abstract class AbstractViewManager%3CENTITY%3E implements Manager%3CENTITY%3E %7B%0A%0A    private @Inject StreamSupplierComponent streamSupplierComponent;%0A%0A    protected AbstractViewManager() %7B%7D%0A%0A    /**%0A     * In the %7B@link State#INITIALIZED%7D-phase, install this %7B@link Manager%7D in%0A     * the %7B@link ManagerComponent%7D so that it can be found by other parts of%0A     * the system.%0A     * %3Cp%3E%0A     * THIS METHOD IS INTENDED TO BE INVOKED AUTOMATICALLY BY THE DEPENDENCY%0A     * INJECTOR. IT SHOULD THEREFORE NEVER BE CALLED DIRECTLY!%0A     *%0A     * @param managerComponent  auto-injected managerComponent%0A     * @param projectComponent  auto-injected projectComponent%0A     */%0A    @ExecuteBefore(INITIALIZED)%0A    final void install(%0A            @WithState(INITIALIZED) ManagerComponent managerComponent,%0A            @WithState(INITIALIZED) ProjectComponent projectComponent) %7B%0A%0A        requireNonNull(projectComponent); // Must be initialized first.%0A        managerComponent.put(this);%0A    %7D%0A%0A    @Override%0A    public Stream%3CENTITY%3E stream() %7B%0A        return streamSupplierComponent.stream(%0A            getTableIdentifier(),%0A            ParallelStrategy.computeIntensityDefault()%0A        );%0A    %7D%0A%0A    @Override%0A    public Persister%3CENTITY%3E persister() %7B%0A        throw readonlyException();%0A    %7D%0A%0A    @Override%0A    public Updater%3CENTITY%3E updater() %7B%0A        throw readonlyException();%0A    %7D%0A%0A    @Override%0A    public Remover%3CENTITY%3E remover() %7B%0A        throw readonlyException();%0A    %7D%0A%0A    private RuntimeException readonlyException() %7B%0A        return new UnsupportedOperationException(format(%0A            %22Manager %25s is based on a VIEW Table and is therefore read-only.%22,%0A            getClass().getSimpleName()%0A        ));%0A    %7D%0A%7D%0A

Create an abstract base class for VIEW Managers