class RelationEntity extends GenericEntity<String> {

    @Schema(description = "对象类型")
    @Column(length = 32, nullable = false, updatable = false)
    private String objectType;

    @Schema(description = "对象名称")
    @Column(length = 64, nullable = false)
    private String objectTypeName;

    @Schema(description = "关系标识")
    @Column(length = 32, nullable = false, updatable = false)
    private String relation;

    @Schema(description = "关系名称")
    @Column(length = 64, nullable = false)
    private String name;

    @Schema(description = "目标对象类型")
    @Column(length = 32, nullable = false, updatable = false)
    private String targetType;

    @Schema(description = "目标对象名称")
    @Column(length = 64, nullable = false)
    private String targetTypeName;

    @Column(nullable = false, updatable = false)
    @Schema(description = "创建时间")
    @DefaultValue(generator = Generators.CURRENT_TIME)
    private Long createTime;

    @Column
    @Schema(description = "说明")
    private String description;

    @Column
    @JsonCodec
    @ColumnType(jdbcType = JDBCType.LONGVARCHAR, javaType = String.class)
    @Schema(description = "其他拓展信息")
    private Map<String, Object> expands;

    @Override
    public String getId() {<FILL_FUNCTION_BODY>}

    public void generateId() {
        setId(
            DigestUtils.md5Hex(
                String.join("|", objectType, relation, targetType)
            )
        );
    }

    public RelationEntity from(String type, String name) {
        this.objectType = type;
        this.objectTypeName = name;
        return this;
    }

    public RelationEntity to(String type, String name) {
        this.targetType = type;
        this.targetTypeName = name;
        return this;
    }

    public RelationEntity relation(String relation, String name) {
        this.relation = relation;
        this.name = name;
        return this;
    }

}

        if (StringUtils.hasText(super.getId())) {
            return super.getId();
        }
        if (StringUtils.hasText(objectType) &&
            StringUtils.hasText(relation) &&
            StringUtils.hasText(targetType)) {
            generateId();
        }
        return super.getId();
    
<no_super_class>