@@ -0,0 +1,2097 @@
+/******************************************************************************%0A *                                                                            *%0A *                    Copyright 2018 Subterranean Security                    *%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 *                                                                            *%0A *****************************************************************************/%0Apackage com.sandpolis.core.instance.storage.converter;%0A%0Aimport javax.persistence.AttributeConverter;%0Aimport javax.persistence.Converter;%0A%0Aimport com.sandpolis.core.proto.util.Platform.Instance;%0A%0A/**%0A * When used on a persistent %7B@link Instance%7D field, this converter makes%0A * database operations much more efficient by replacing %7B@link Instance%7Ds with%0A * their numeric identifier.%0A * %0A * @author cilki%0A * @since 5.0.0%0A */%0A@Converter%0Apublic class InstanceConverter implements AttributeConverter%3CInstance, Integer%3E %7B%0A%0A%09@Override%0A%09public Integer convertToDatabaseColumn(Instance instance) %7B%0A%09%09return instance.getNumber();%0A%09%7D%0A%0A%09@Override%0A%09public Instance convertToEntityAttribute(Integer dbData) %7B%0A%09%09return Instance.forNumber(dbData);%0A%09%7D%0A%0A%7D%0A

Add JPA Converter so Instance types can be persisted cleanly