From d6fccd5b20df6e67bc472c05ec3471099229711d Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Tue, 13 Jun 2023 15:34:28 +0200 Subject: [PATCH] #3611 - Upgrade to Spring 6, Boot 3, Wicket 10, etc. - Fix compatibility of knowledge base type column with Hibernate 6 --- .../ukp/inception/kb/model/KnowledgeBase.java | 2 ++ .../inception/kb/model/KnowledgeBaseType.java | 33 +++++++++++++++++++ inception/pom.xml | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBaseType.java diff --git a/inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBase.java b/inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBase.java index bcb2a6c809f..000995c965a 100644 --- a/inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBase.java +++ b/inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBase.java @@ -29,6 +29,7 @@ import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; +import org.hibernate.annotations.Type; import de.tudarmstadt.ukp.clarin.webanno.model.Project; import de.tudarmstadt.ukp.inception.kb.IriConstants; @@ -82,6 +83,7 @@ public class KnowledgeBase private String name; @Enumerated + @Type(KnowledgeBaseType.class) private RepositoryType type; /** diff --git a/inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBaseType.java b/inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBaseType.java new file mode 100644 index 00000000000..2c4b0d7a7be --- /dev/null +++ b/inception/inception-kb/src/main/java/de/tudarmstadt/ukp/inception/kb/model/KnowledgeBaseType.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Technische Universität Darmstadt under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The Technische Universität Darmstadt + * licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package de.tudarmstadt.ukp.inception.kb.model; + +import de.tudarmstadt.ukp.clarin.webanno.support.PersistentEnumIntegerUserType; +import de.tudarmstadt.ukp.inception.kb.RepositoryType; + +public class KnowledgeBaseType + extends PersistentEnumIntegerUserType +{ + private static final long serialVersionUID = 1L; + + @Override + public Class returnedClass() + { + return RepositoryType.class; + } +} diff --git a/inception/pom.xml b/inception/pom.xml index edbb22efdf2..1a7fe4307ce 100644 --- a/inception/pom.xml +++ b/inception/pom.xml @@ -243,7 +243,7 @@ oss.sonatype.org-snapshot - https://oss.sonatype.org/content/repositories/snapshots + https://s01.oss.sonatype.org/content/repositories/snapshots false