private void delegate(final EntityType model, Delegate delegate, SerializerConfig config,
            CodeWriter writer) throws IOException {
        Parameter[] params = delegate.getParameters().toArray(new Parameter[0]);
        writer.beginPublicMethod(delegate.getReturnType(), delegate.getName(), params);

        // body start
        writer.beginLine(RETURN + writer.getRawName(delegate.getDelegateType()) + "." + delegate.getName() + "(");
        writer.append("this");
        if (!model.equals(delegate.getDeclaringType())) {
            int counter = 0;
            EntityType type = model;
            while (type != null && !type.equals(delegate.getDeclaringType())) {
                type = type.getSuperType() != null ? type.getSuperType().getEntityType() : null;
                counter++;
            }
            for (int i = 0; i < counter; i++) {
                writer.append("._super");
            }
        }
        for (Parameter parameter : delegate.getParameters()) {
            writer.append(COMMA).append(parameter.getName());
        }
        writer.append(");\n");

        // body end
        writer.end();
    }
Create a new {@code EntitySerializer} instance

@param mappings type mappings to be used
@param keywords keywords to be used
querydsl-codegen/src/main/java/com/querydsl/codegen/DefaultEntitySerializer.java