doc-architect/doc-architect-core/src/main/java/com/docarchitect/core/scanner/impl/java/MongoDbScanner.java [236:261]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            String primaryKey = null;

            for (FieldDeclaration fieldDecl : classDecl.getFields()) {
                // Check for @DBRef relationship
                if (hasAnnotation(fieldDecl, DBREF_ANNOTATION)) {
                    extractDbRefRelationship(fieldDecl, fullyQualifiedName, relationships);
                } else {
                    // Regular field or embedded document
                    DataEntity.Field field = extractField(fieldDecl);
                    if (field != null) {
                        fields.add(field);
                        if (hasAnnotation(fieldDecl, ID_ANNOTATION) && primaryKey == null) {
                            primaryKey = field.name();
                        }
                    }
                }
            }

            DataEntity entity = new DataEntity(
                fullyQualifiedName,
                collectionName,
                DATA_ENTITY_TYPE_COLLECTION,
                fields,
                primaryKey,
                description
            );
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



doc-architect/doc-architect-core/src/main/java/com/docarchitect/core/scanner/impl/java/MongoDbScanner.java [378:403]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            String primaryKey = null;

            for (FieldDeclaration fieldDecl : classDecl.getFields()) {
                // Check for @DBRef relationship
                if (hasAnnotation(fieldDecl, DBREF_ANNOTATION)) {
                    extractDbRefRelationship(fieldDecl, fullyQualifiedName, relationships);
                } else {
                    // Regular field or embedded document
                    DataEntity.Field field = extractField(fieldDecl);
                    if (field != null) {
                        fields.add(field);
                        if (hasAnnotation(fieldDecl, ID_ANNOTATION) && primaryKey == null) {
                            primaryKey = field.name();
                        }
                    }
                }
            }

            DataEntity entity = new DataEntity(
                fullyQualifiedName,
                collectionName,
                DATA_ENTITY_TYPE_COLLECTION,
                fields,
                primaryKey,
                description
            );
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



