protected void serialize(EntityType model, Property field, Type type, CodeWriter writer,
            String factoryMethod, String... args) throws IOException {
        Supertype superType = model.getSuperType();
        // construct value
        StringBuilder value = new StringBuilder();
        if (field.isInherited() && superType != null) {
            if (!superType.getEntityType().hasEntityFields()) {
                value.append("_super.").append(field.getEscapedName());
            }
        } else {
            value.append(factoryMethod).append("(\"").append(field.getName()).append(QUOTE);
            for (String arg : args) {
                value.append(COMMA).append(arg);
            }
            value.append(")");
        }

        // serialize it
        if (field.isInherited()) {
            writer.line("//inherited");
        }
        if (value.length() > 0) {
            writer.publicFinal(type, field.getEscapedName(), value.toString());
        } else {
            writer.publicFinal(type, field.getEscapedName());
        }
    }
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