Skip to content

@Connection

Delegate method param extension

Used to reference connection object, selected for repository method. May be used to avoid writing redundant providers injection and use direct connection from method argument.

List doSomething(@Connection OObjectDatabaseTx db) {...}

Also, may be used for object/document mixins: object and document connections share common abstraction (ODatabaseInternal) which may be used to write generic logic for both connections.

List doSomething(@Connection ODatabaseInternal db) {...}

Even Object may be used as type, to accept any connection type and, for example, branch logic inside method according to connection object type:

List doSomething(@Connection Object db) {...}