code: @Override
     public void newEmbeddedRelationship(
              final Project project,
              final JavaResource resource,
              final String fieldName,
              final String fieldType) throws FileNotFoundException
     {
        JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
        JavaClassSource entityClass = getJavaClassFrom(resource);
        JavaClassSource fieldEntityClass;
        if (areTypesSame(fieldType, entityClass.getCanonicalName()))
        {
           fieldEntityClass = entityClass;
        }
        else
        {
           fieldEntityClass = findEntity(project, fieldType);
           entityClass.addImport(fieldEntityClass);
        }
  
        addFieldTo(entityClass, fieldEntityClass.getName(), fieldName,
                 Embedded.class.getName());
        java.saveJavaSource(entityClass);
     }
docs: Creates an Embedded relationship
  
  @param project
  @param resource
  @param fieldName
  @param fieldType
  @throws FileNotFoundException