protected void constructors(EntityType model, SerializerConfig config,
            CodeWriter writer) throws IOException {

        String localName = writer.getRawName(model);
        String genericName = writer.getGenericName(true, model);

        boolean hasEntityFields = model.hasEntityFields() || superTypeHasEntityFields(model);
        boolean stringOrBoolean = model.getOriginalCategory() == TypeCategory.STRING
                || model.getOriginalCategory() == TypeCategory.BOOLEAN;
        String thisOrSuper = hasEntityFields ? THIS : SUPER;
        String additionalParams = getAdditionalConstructorParameter(model);
        String classCast = localName.equals(genericName) ? EMPTY : "(Class) ";


        // String
        constructorsForVariables(writer, model);

        // Path
        if (!localName.equals(genericName)) {
            suppressAllWarnings(writer);
        }
        Type simpleModel = new SimpleType(model);
        if (model.isFinal()) {
            Type type = new ClassType(Path.class, simpleModel);
            writer.beginConstructor(new Parameter("path", type));
        } else {
            Type type = new ClassType(Path.class, new TypeExtends(simpleModel));
            writer.beginConstructor(new Parameter("path", type));
        }

        if (!hasEntityFields) {
            if (stringOrBoolean) {
                writer.line("super(path.getMetadata());");
            } else {
                writer.line("super(", classCast, "path.getType(), path.getMetadata()" + additionalParams + ");");
            }
            constructorContent(writer, model);
        } else {
            writer.line("this(", classCast, "path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));");
        }
        writer.end();

        // PathMetadata
        if (hasEntityFields) {
            writer.beginConstructor(PATH_METADATA);
            writer.line("this(metadata, PathInits.getFor(metadata, INITS));");
            writer.end();
        } else {
            if (!localName.equals(genericName)) {
                suppressAllWarnings(writer);
            }
            writer.beginConstructor(PATH_METADATA);
            if (stringOrBoolean) {
                writer.line("super(metadata);");
            } else {
                writer.line("super(", classCast, writer.getClassConstant(localName) + COMMA + "metadata" + additionalParams + ");");
            }
            constructorContent(writer, model);
            writer.end();
        }

        // PathMetadata, PathInits
        if (hasEntityFields) {
            if (!localName.equals(genericName)) {
                suppressAllWarnings(writer);
            }
            writer.beginConstructor(PATH_METADATA, PATH_INITS);
            writer.line(thisOrSuper, "(", classCast, writer.getClassConstant(localName) + COMMA + "metadata, inits" + additionalParams + ");");
            if (!hasEntityFields) {
                constructorContent(writer, model);
            }
            writer.end();
        }

        // Class, PathMetadata, PathInits
        if (hasEntityFields) {
            Type type = new ClassType(Class.class, new TypeExtends(model));
            writer.beginConstructor(new Parameter("type", type), PATH_METADATA, PATH_INITS);
            writer.line("super(type, metadata, inits" + additionalParams + ");");
            initEntityFields(writer, config, model);
            constructorContent(writer, model);
            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