public DocumentIdMapping GetMapping()
        {
            var mappingPart = this as IFluentMappingPart;

            var mapping = new DocumentIdMapping(mappingPart.Name, (this as IHasBridge).FieldBridge as ITwoWayFieldBridge, this.Getter)
                              {
                                  Boost = mappingPart.Boost
                              };
            return mapping;
        }
Exemple #2
0
        private void CollectAnalyzers(
            DocumentMapping @class, Analyzer parentAnalyzer, bool isRoot, string prefix, ISet<System.Type> processedClasses
        )
        {
            foreach (var bridge in @class.ClassBridges)
            {
                var bridgeAnalyzer = bridge.Analyzer ?? parentAnalyzer;
                if (bridgeAnalyzer == null)
                {
                    throw new NotSupportedException("Analyzer should not be undefined");
                }

                analyzer.AddScopedAnalyzer(prefix + bridge.Name, bridgeAnalyzer);
            }

            if (isRoot && @class.DocumentId != null)
            {
                idMapping = @class.DocumentId;
            }

            foreach (var field in @class.Fields)
            {
                CollectAnalyzer(field, parentAnalyzer, prefix);
            }

            foreach (var embedded in @class.Embedded)
            {
                CollectAnalyzers(
                    embedded.Class, parentAnalyzer, false, prefix + embedded.Prefix, processedClasses
                );
            }
        }