Skip to content

Commit aebf2ec

Browse files
committed
feat: create orale nosql template supplier
Signed-off-by: Otavio Santana <[email protected]>
1 parent 92aa633 commit aebf2ec

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* and Apache License v2.0 which accompanies this distribution.
6+
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7+
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
8+
*
9+
* You may elect to redistribute this code under either of these licenses.
10+
*
11+
* Contributors:
12+
*
13+
* Otavio Santana
14+
* Alessandro Moscatelli
15+
* Maximillian Arruda
16+
*/
17+
package org.eclipse.jnosql.databases.oracle.tck;
18+
19+
import jakarta.enterprise.inject.se.SeContainerInitializer;
20+
import jakarta.enterprise.inject.spi.CDI;
21+
import jakarta.nosql.Template;
22+
import jakarta.nosql.tck.TemplateSupplier;
23+
import org.eclipse.jnosql.databases.oracle.communication.Database;
24+
import org.eclipse.jnosql.databases.oracle.communication.OracleNoSQLConfigurations;
25+
import org.eclipse.jnosql.mapping.core.config.MappingConfigurations;
26+
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
27+
28+
29+
public class OracleNoSQLTemplateSupplier implements TemplateSupplier {
30+
31+
static {
32+
System.setProperty(OracleNoSQLConfigurations.HOST.get() + ".1", Database.INSTANCE.host());
33+
System.setProperty(MappingConfigurations.DOCUMENT_DATABASE.get(), "jakarta-nosql-tck");
34+
SeContainerInitializer.newInstance().initialize();
35+
}
36+
37+
@Override
38+
public Template get() {
39+
return CDI.current().select(DocumentTemplate.class).get();
40+
}
41+
}

0 commit comments

Comments
 (0)