@@ -0,0 +1,2156 @@
+/*%0A * Copyright 2018 B2i Healthcare Pte Ltd, http://b2i.sg%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of 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,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.b2international.snowowl.datastore.server.history;%0A%0Aimport java.util.Objects;%0A%0Aimport org.eclipse.emf.ecore.EClass;%0A%0Aimport com.b2international.snowowl.datastore.cdo.LocalDbUtils;%0A%0A/**%0A * Minimal implementation of %7B@link PreparedStatementKey%7D that is identified by the EClass %0A * it is queried against.%0A */%0Apublic final class OtherComponentStatementKey implements PreparedStatementKey %7B%0A%0A%09private static final String QUERY_TEMPLATE = %22SELECT %22%0A%09%09%09+ %22component.CDO_ID, %22 // Redundant, only returned to be compatible with all other %22other component%22 queries%0A%09%09%09+ %22component.CDO_CREATED, %22%0A%09%09%09+ %22component.CDO_REVISED %22%0A%09%09%09// -------------------------------%0A%09%09%09+ %22FROM %25s component %22%0A%09%09%09// -------------------------------%0A%09%09%09+ %22WHERE component.CDO_ID = ? %22 %0A%09%09%09+ %22AND component.CDO_BRANCH = ? %22%0A%09%09%09+ %22AND component.CDO_CREATED %3C= ? %22%0A%09%09%09+ %22ORDER BY component.CDO_CREATED DESC %22;%0A%09%0A%09private final EClass eClass;%0A%0A%09public OtherComponentStatementKey(final EClass eClass) %7B%0A%09%09this.eClass = eClass;%0A%09%7D%0A%0A%09public String getQuery() %7B%0A%09%09final String tableName = LocalDbUtils.tableNameFor(eClass);%0A%09%09return String.format(QUERY_TEMPLATE, tableName);%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09return Objects.hash(eClass);%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(final Object obj) %7B%0A%09%09if (this == obj) %7B return true; %7D%0A%09%09if (obj == null) %7B return false; %7D%0A%09%09if (getClass() != obj.getClass()) %7B return false; %7D%0A%0A%09%09final OtherComponentStatementKey other = (OtherComponentStatementKey) obj;%0A%09%09return Objects.equals(eClass, other.eClass);%0A%09%7D%0A%7D%0A

Introduce prepared statement key for determining minor...