com.sandinh.couchbase.access

Type members

Classlikes

abstract
class CaoBase[T, U, D <: Document[U]](bucket: ScalaBucket)(implicit evidence$1: ClassTag[D]) extends CaoTrait[T, String, U, D]

Base class for Couchbase Access Object. This class permit we interact (get/set/update/..) with couchbase server through a typed interface. Ex, given a class D <: Document (that means D is a subclass of com.couchbase.client.java.document.Document) instead of

Base class for Couchbase Access Object. This class permit we interact (get/set/update/..) with couchbase server through a typed interface. Ex, given a class D <: Document (that means D is a subclass of com.couchbase.client.java.document.Document) instead of

 // com.couchbase.client.java.AsyncBucket#get
 get(id: String): Observable[D]
 // com.couchbase.client.java.AsyncBucket#upsert
 upsert(document: D): Observable[D]

, we can:

 get(id: String): Future[T]
 set(id: String, t: T): Future[D]

With T is your own type, ex case class User(name: String, age: Int)

To able to do that, we need implement this class' 2 abstract methods:

 def reads(u: U): T
 def writes(t: T): U
Type Params
D

the Document type

T

type that will be encoded before upsert using writes(t: T): U, and decoded after get using reads(u: U): T

U

the Document's content type, ex JsValue, primitive types,.. See classes that implement com.couchbase.client.java.document.Document for all available type (of course you can implement your own)

See also

WithCaoKey1

class JsCao[T](val bucket: ScalaBucket)(implicit val fmt: Format[T]) extends CaoBase[T, JsValue, JsDocument] with JsCaoTrait[T]

Base class for Couchbase Access Object to access json documents that can be decode/encode to/from the T type

Base class for Couchbase Access Object to access json documents that can be decode/encode to/from the T type

abstract
class JsCao1[T, A](val bucket: ScalaBucket)(implicit val fmt: Format[T]) extends JsCaoTrait[T] with WithCaoKey1[T, A, JsValue, JsDocument]

Base class for Couchbase Access Object to access json documents that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A) method

Base class for Couchbase Access Object to access json documents that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A) method

abstract
class JsCao2[T, A, B](bucket: ScalaBucket)(implicit evidence$1: Format[T]) extends JsCao[T] with WithCaoKey2[T, A, B, JsValue, JsDocument]

Base class for Couchbase Access Object to access json documents that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A, B) method

Base class for Couchbase Access Object to access json documents that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A, B) method

trait JsCaoTrait[T]
abstract
class StrCao[T](val bucket: ScalaBucket) extends CaoBase[T, String, CompatStringDocument] with StrCaoTrait[T]

Base class for Couchbase Access Object to access StringDocument that can be decode/encode to/from the T type

Base class for Couchbase Access Object to access StringDocument that can be decode/encode to/from the T type

abstract
class StrCao1[T, A](val bucket: ScalaBucket) extends StrCaoTrait[T] with WithCaoKey1[T, A, String, CompatStringDocument]

Base class for Couchbase Access Object to access StringDocument that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A) method

Base class for Couchbase Access Object to access StringDocument that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A) method

abstract
class StrCao2[T, A, B](bucket: ScalaBucket) extends StrCao[T] with WithCaoKey2[T, A, B, String, CompatStringDocument]

Base class for Couchbase Access Object to access StringDocument that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A, B) method

Base class for Couchbase Access Object to access StringDocument that can be decode/encode to/from the T type - which is store in couchbase at key generated from the T.key(A, B) method

trait StrCaoTrait[T]