protected void introFactoryMethods(CodeWriter writer, final EntityType model) throws IOException {
        String localName = writer.getRawName(model);
        String genericName = writer.getGenericName(true, model);
        Set<Integer> sizes = new HashSet<>();

        for (Constructor c : model.getConstructors()) {
            // begin
            if (!localName.equals(genericName)) {
                writer.suppressWarnings(UNCHECKED);
            }
            Type returnType = new ClassType(ConstructorExpression.class, model);
            final boolean asExpr = sizes.add(c.getParameters().size());
            writer.beginStaticMethod(returnType, "create", c.getParameters(),
                    new Function<Parameter, Parameter>() {
                @Override
                public Parameter apply(Parameter p) {
                    Type type;
                    if (!asExpr) {
                        type = typeMappings.getExprType(
                                p.getType(), model, false, false, true);
                    } else if (p.getType().isFinal()) {
                        type = new ClassType(Expression.class, p.getType());
                    } else {
                        type = new ClassType(Expression.class, new TypeExtends(p.getType()));
                    }
                    return new Parameter(p.getName(), type);
                }
            });

            // body
            // TODO : replace with class reference
            writer.beginLine("return Projections.constructor(");
//            if (!localName.equals(genericName)) {
//                writer.append("(Class)");
//            }
            writer.append(writer.getClassConstant(localName));
            writer.append(", new Class<?>[]{");
            boolean first = true;
            for (Parameter p : c.getParameters()) {
                if (!first) {
                    writer.append(COMMA);
                }
                if (Types.PRIMITIVES.containsKey(p.getType())) {
                    Type primitive = Types.PRIMITIVES.get(p.getType());
                    writer.append(writer.getClassConstant(primitive.getFullName()));
                } else {
                    writer.append(writer.getClassConstant(writer.getRawName(p.getType())));
                }
                first = false;
            }
            writer.append("}");

            for (Parameter p : c.getParameters()) {
                writer.append(COMMA).append(p.getName());
            }

            // end
            writer.append(");\n");
            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