code: private Object prepareCompositeIdObject(final SingularAttribute attribute, Object compositeId,
              Map<String, String> uniquePKs, MetamodelImpl metaModel)
      {
          Field[] fields = attribute.getBindableJavaType().getDeclaredFields();
          EmbeddableType embeddable = metaModel.embeddable(attribute.getBindableJavaType());
  
          for (Field field : attribute.getBindableJavaType().getDeclaredFields())
          {
              if (!ReflectUtils.isTransientOrStatic(field))
              {
                  if (metaModel.isEmbeddable(((AbstractAttribute) embeddable.getAttribute(field.getName()))
                          .getBindableJavaType()))
                  {
                      try
                      {
                          field.setAccessible(true);
                          Object embeddedObject = prepareCompositeIdObject(
                                  (SingularAttribute) embeddable.getAttribute(field.getName()),
                                  KunderaCoreUtils.initialize(((AbstractAttribute) embeddable.getAttribute(field
                                          .getName())).getBindableJavaType(), field.get(compositeId)), uniquePKs,
                                  metaModel);
                          PropertyAccessorHelper.set(compositeId, field, embeddedObject);
                      }
                      catch (IllegalAccessException e)
                      {
                          log.error(e.getMessage());
                      }
                  }
                  else
                  {
                      PropertyAccessorHelper.set(
                              compositeId,
                              field,
                              PropertyAccessorHelper.fromSourceToTargetClass(field.getType(), String.class,
                                      uniquePKs.get(field.getName())));
                  }
              }
          }
          return compositeId;
      }
docs: Prepare composite id object.
  
  @param attribute
  the attribute
  @param compositeId
  the composite id
  @param uniquePKs
  the unique p ks
  @param metaModel
  the meta model
  @return the object