I need to implement composite keys in hyperledger so that I could have a unique key based on the attributes put into the ledger. The function CreateCompositeKey(object
For Java implementation it did not clearly come out in the documentation/ examples, did a little digging around and you can use 'compositeKey.toString()' as the composite key.
Example below:
final String compositeKey = stub.createCompositeKey("my-key-part-1", "my-key-part-2").toString();
stub.putStringState(compositeKey, myJSONString); // use this
stub.putState(compositeKey, myJSONString.getBytes()); // or this