Skip to content

Commit 9b18a99

Browse files
authored
Merge pull request #97 from fjtirado/9.104.x-prod-2284
[Fix_#2284] Adding back JSON support for postgresql (apache#2285)
2 parents 3cd7a6c + b43c3ac commit 9b18a99

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.HashMap;
2525
import java.util.Map;
2626
import java.util.Optional;
27+
import java.util.ServiceLoader;
2728
import java.util.Set;
2829

2930
import org.kie.kogito.event.process.MultipleProcessInstanceDataEvent;
@@ -50,6 +51,7 @@
5051
import org.kie.kogito.index.model.ProcessInstance;
5152
import org.kie.kogito.index.storage.ProcessInstanceStorage;
5253
import org.kie.kogito.persistence.api.StorageServiceCapability;
54+
import org.kie.kogito.persistence.api.StorageServiceCapabilityProvider;
5355

5456
import jakarta.enterprise.context.ApplicationScoped;
5557
import jakarta.enterprise.inject.Instance;
@@ -279,6 +281,8 @@ private void indexSla(ProcessInstanceEntity orInit, ProcessInstanceSLAEventBody
279281

280282
@Override
281283
public Set<StorageServiceCapability> capabilities() {
282-
return EnumSet.of(StorageServiceCapability.COUNT);
284+
Set<StorageServiceCapability> result = EnumSet.of(StorageServiceCapability.COUNT);
285+
ServiceLoader.load(StorageServiceCapabilityProvider.class).forEach(s -> result.addAll(s.capabilities()));
286+
return result;
283287
}
284288
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.kie.kogito.index.postgresql;
20+
21+
import java.util.Set;
22+
23+
import org.kie.kogito.persistence.api.StorageServiceCapability;
24+
import org.kie.kogito.persistence.api.StorageServiceCapabilityProvider;
25+
26+
public class PostgresqlStorageServiceCapabilities implements StorageServiceCapabilityProvider {
27+
28+
@Override
29+
public Set<StorageServiceCapability> capabilities() {
30+
return Set.of(StorageServiceCapability.JSON_QUERY);
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
org.kie.kogito.index.postgresql.PostgresqlStorageServiceCapabilities
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.kie.kogito.persistence.api;
20+
21+
import java.util.Set;
22+
23+
public interface StorageServiceCapabilityProvider {
24+
Set<StorageServiceCapability> capabilities();
25+
}

0 commit comments

Comments
 (0)