File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/test/java/org/soujava/demos/mongodb/config Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .soujava .demos .mongodb .config ;
2+
3+ import jakarta .annotation .Priority ;
4+ import jakarta .enterprise .context .ApplicationScoped ;
5+ import jakarta .enterprise .inject .Alternative ;
6+ import jakarta .enterprise .inject .Default ;
7+ import jakarta .enterprise .inject .Produces ;
8+ import jakarta .enterprise .inject .Typed ;
9+ import jakarta .interceptor .Interceptor ;
10+ import org .eclipse .jnosql .communication .semistructured .DatabaseManager ;
11+ import org .eclipse .jnosql .databases .mongodb .communication .MongoDBDocumentManager ;
12+ import org .eclipse .jnosql .mapping .Database ;
13+ import org .eclipse .jnosql .mapping .DatabaseType ;
14+
15+ import java .util .function .Supplier ;
16+
17+ @ ApplicationScoped
18+ @ Alternative
19+ @ Priority (Interceptor .Priority .APPLICATION )
20+ public class ManagerSupplier implements Supplier <DatabaseManager > {
21+
22+ @ Produces
23+ @ Database (DatabaseType .DOCUMENT )
24+ @ Default
25+ @ Typed ({DatabaseManager .class , MongoDBDocumentManager .class })
26+ public MongoDBDocumentManager get () {
27+ return DatabaseContainer .INSTANCE .get ("hotel" );
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments