-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Otavio Santana <[email protected]>
- Loading branch information
1 parent
f5d8f52
commit 98816ef
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
chapter-12/src/main/java/org/jnosql/demo/se/RedisStructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.jnosql.demo.se; | ||
|
||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
import org.eclipse.jnosql.databases.redis.communication.Counter; | ||
import org.eclipse.jnosql.databases.redis.communication.SortedSet; | ||
import org.eclipse.jnosql.mapping.keyvalue.KeyValueDatabase; | ||
|
||
@ApplicationScoped | ||
public class RedisStructure { | ||
|
||
@Inject | ||
@KeyValueDatabase("home") | ||
private Counter counter; | ||
|
||
@Inject | ||
@KeyValueDatabase("game") | ||
private SortedSet sortedSet; | ||
|
||
|
||
public void increment() { | ||
counter.increment(); | ||
} | ||
|
||
public void increment(String name, long value) { | ||
sortedSet.increment(name, value); | ||
} | ||
} |