func (m FieldMap) ID() *FieldMappingDescriptor {
	for _, f := range m {
		if f.IsIDField {
			return f
		}
	}
	return nil
}
ID returns the FieldMappingDescriptor for the ID field of the schema.
package entproto
import (
	"fmt"
	"sort"
	"strings"
	"entgo.io/ent/entc/gen"
	"github.com/jhump/protoreflect/desc"
)
func (a *Adapter) FieldMap(schemaName string) (FieldMap, error) {
	bt, err := extractGenTypeByName(a.graph, schemaName)
	if err != nil {
		return nil, err
	}
	md, err := a.GetMessageDescriptor(schemaName)
	if err != nil {
		return nil, err
	}
	return a.mapFields(bt, md)
}
type FieldMap map[string]*FieldMappingDescriptor
func (m FieldMap) Fields() []*FieldMappingDescriptor {
	var out []*FieldMappingDescriptor
	for _, f := range m {
		if !f.IsEdgeField {
			out = append(out, f)
		}
	}
	sort.Slice(out, func(i, j int) bool {
		return out[i].PbStructField() < out[j].PbStructField()
	})
	return out
}