Skip to content

Commit

Permalink
feat: redis structure sample
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Aug 29, 2023
1 parent f5d8f52 commit 98816ef
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions chapter-12/src/main/java/org/jnosql/demo/se/RedisStructure.java
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);
}
}

0 comments on commit 98816ef

Please sign in to comment.