Skip to content

Commit

Permalink
OGM-1397 Use table.pkColumnValue for an Infinispan counter name
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD committed Feb 10, 2018
1 parent 832bede commit fc96107
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -26,8 +26,16 @@ public TableClusteredCounterHandler(EmbeddedCacheManager cacheManager) {

@Override
public Number nextValue(NextValueRequest request) {
String counterName = request.getKey().getColumnValue();
String counterName = counterName( request );
StrongCounter strongCounter = getCounterOrCreateIt( counterName, request.getInitialValue() );
return nextValue( request, strongCounter );
}

private String counterName(NextValueRequest request) {
StringBuilder builder = new StringBuilder();
builder.append( request.getKey().getTable() );
builder.append( "." );
builder.append( request.getKey().getColumnValue() );
return builder.toString();
}
}

0 comments on commit fc96107

Please sign in to comment.