longevity

A Persistence Framework for Scala and NoSQL

View project on GitHub

repositories in the context

The longevity context provides three different repositories:

  • one that goes against your application database - context.repo
  • one that goes against your test database - context.testRepo
  • one that goes against an in-memory database - context.inMemTestRepo

You should easily be able to inject these repositories into whatever dependency injection approach you are using. For instance, with Scaldi:

import longevity.persistence.Repo
import scala.concurrent.Future
import scaldi.Module

class PersistenceModule extends Module {
  bind[Repo[Future, DomainModel]] to context.repo
}

class TestPersistenceModule extends Module {
  bind[Repo[Future, DomainModel]] to context.testRepo
}
prev: configuring your longevity context
up: the longevity context
next: optimistic locking