Skip to content

Better approach than producer method to inject specific MongoDB Collections #5

@emmanuelbernard

Description

@emmanuelbernard

Today, if I want a typsafe inject, I do the following

// Definition
class SomeProducer {
    @Inject @Mongo(db="retail", collection="orders") @OrderCollection
    DBCollection collection;
}

// Usage
class SomeBusinessObject {
    @Inject @OrderCollection
    DBCollection orders;
}

Is that correct?
Is that considered the best approach or should we offer some helper / alternative solution in the framework?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions