diff --git a/chapter-12/src/main/java/org/jnosql/demo/se/RedisStructure.java b/chapter-12/src/main/java/org/jnosql/demo/se/RedisStructure.java new file mode 100644 index 0000000..8625035 --- /dev/null +++ b/chapter-12/src/main/java/org/jnosql/demo/se/RedisStructure.java @@ -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); + } +}