code: private String getKeyAsString(Object id, EntityMetadata metadata, MetamodelImpl metaModel)
      {
          if (metaModel.isEmbeddable(((AbstractAttribute) metadata.getIdAttribute()).getBindableJavaType()))
          {
              return KunderaCoreUtils.prepareCompositeKey(metadata, id);
          }
          return id.toString();
      }
docs: Gets the key as string.
  
  @param id
  the id
  @param metadata
  the metadata
  @param metaModel
  the meta model
  @return the key as string