This is an automated email from the ASF dual-hosted git repository.
fjtiradosarti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git
The following commit(s) were added to refs/heads/main by this push:
new 3c980ef8e [Fix_#2284] Adding back JSON support for postgresql (#2285)
3c980ef8e is described below
commit 3c980ef8e5104e62577d2ecb092a3c94f65953e4
Author: Francisco Javier Tirado Sarti
<[email protected]>
AuthorDate: Tue Dec 23 18:52:46 2025 +0100
[Fix_#2284] Adding back JSON support for postgresql (#2285)
Signed-off-by: fjtirado <[email protected]>
---
.../jpa/storage/ProcessInstanceEntityStorage.java | 6 +++-
.../PostgresqlStorageServiceCapabilities.java | 32 ++++++++++++++++++++++
...ersistence.api.StorageServiceCapabilityProvider | 19 +++++++++++++
.../api/StorageServiceCapabilityProvider.java | 25 +++++++++++++++++
4 files changed, 81 insertions(+), 1 deletion(-)
diff --git
a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java
b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java
index bc654d7d8..77b5947e5 100644
---
a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java
+++
b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java
@@ -24,6 +24,7 @@ import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
+import java.util.ServiceLoader;
import java.util.Set;
import org.kie.kogito.event.process.MultipleProcessInstanceDataEvent;
@@ -50,6 +51,7 @@ import org.kie.kogito.index.model.MilestoneStatus;
import org.kie.kogito.index.model.ProcessInstance;
import org.kie.kogito.index.storage.ProcessInstanceStorage;
import org.kie.kogito.persistence.api.StorageServiceCapability;
+import org.kie.kogito.persistence.api.StorageServiceCapabilityProvider;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Instance;
@@ -279,6 +281,8 @@ public class ProcessInstanceEntityStorage extends
AbstractJPAStorageFetcher<Stri
@Override
public Set<StorageServiceCapability> capabilities() {
- return EnumSet.of(StorageServiceCapability.COUNT);
+ Set<StorageServiceCapability> result =
EnumSet.of(StorageServiceCapability.COUNT);
+ ServiceLoader.load(StorageServiceCapabilityProvider.class).forEach(s
-> result.addAll(s.capabilities()));
+ return result;
}
}
diff --git
a/data-index/data-index-storage/data-index-storage-postgresql/src/main/java/org/kie/kogito/index/postgresql/PostgresqlStorageServiceCapabilities.java
b/data-index/data-index-storage/data-index-storage-postgresql/src/main/java/org/kie/kogito/index/postgresql/PostgresqlStorageServiceCapabilities.java
new file mode 100644
index 000000000..c34465734
--- /dev/null
+++
b/data-index/data-index-storage/data-index-storage-postgresql/src/main/java/org/kie/kogito/index/postgresql/PostgresqlStorageServiceCapabilities.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF 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. You may obtain a copy of the License at
+ *
+ * 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 org.kie.kogito.index.postgresql;
+
+import java.util.Set;
+
+import org.kie.kogito.persistence.api.StorageServiceCapability;
+import org.kie.kogito.persistence.api.StorageServiceCapabilityProvider;
+
+public class PostgresqlStorageServiceCapabilities implements
StorageServiceCapabilityProvider {
+
+ @Override
+ public Set<StorageServiceCapability> capabilities() {
+ return Set.of(StorageServiceCapability.JSON_QUERY);
+ }
+}
diff --git
a/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/META-INF/services/org.kie.kogito.persistence.api.StorageServiceCapabilityProvider
b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/META-INF/services/org.kie.kogito.persistence.api.StorageServiceCapabilityProvider
new file mode 100644
index 000000000..8b97f6ac8
--- /dev/null
+++
b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/META-INF/services/org.kie.kogito.persistence.api.StorageServiceCapabilityProvider
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF 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. You may obtain a copy of the License at
+#
+# 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.
+#
+org.kie.kogito.index.postgresql.PostgresqlStorageServiceCapabilities
\ No newline at end of file
diff --git
a/persistence-commons/persistence-commons-api/src/main/java/org/kie/kogito/persistence/api/StorageServiceCapabilityProvider.java
b/persistence-commons/persistence-commons-api/src/main/java/org/kie/kogito/persistence/api/StorageServiceCapabilityProvider.java
new file mode 100644
index 000000000..0f90586d3
--- /dev/null
+++
b/persistence-commons/persistence-commons-api/src/main/java/org/kie/kogito/persistence/api/StorageServiceCapabilityProvider.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF 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. You may obtain a copy of the License at
+ *
+ * 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 org.kie.kogito.persistence.api;
+
+import java.util.Set;
+
+public interface StorageServiceCapabilityProvider {
+ Set<StorageServiceCapability> capabilities();
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]