com.novus.salat.dao

BaseDAOMethods

trait BaseDAOMethods [ObjectType <: AnyRef, ID] extends AnyRef

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. BaseDAOMethods
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Abstract Value Members

  1. def count (q: DBObject = MongoDBObject.empty, fieldsThatMustExist: List[String] = Nil, fieldsThatMustNotExist: List[String] = Nil): Long

    Count the number of documents matching the search criteria.

    Count the number of documents matching the search criteria.

    q

    object for which to search

    fieldsThatMustExist

    list of field keys that must exist

    fieldsThatMustNotExist

    list of field keys that must not exist

    returns

    count of documents matching the search criteria

    Attributes
    abstract
  2. def defaultWriteConcern : WriteConcern

    In the absence of a specified write concern, supplies a default write concern.

    In the absence of a specified write concern, supplies a default write concern.

    returns

    default write concern to use for insert, update, save and remove operations

    Attributes
    abstract
  3. def find [A, B] (ref: A, keys: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): SalatMongoCursor[ObjectType]

    Queries for an object in this collection.

    Queries for an object in this collection.

    A

    type view bound to DBObject

    B

    type view bound to DBObject

    ref

    object for which to search

    keys

    fields to return

    returns

    a typed cursor to iterate over results

    Attributes
    abstract
  4. def findOne [A] (t: A)(implicit arg0: (A) ⇒ DBObject): Option[ObjectType]

    Returns a single object from this collection.

    Returns a single object from this collection.

    A

    type view bound to DBObject

    t

    object for which to search

    returns

    (Option[ObjectType]) Some() of the object found, or None if no such object exists

    Attributes
    abstract
  5. def findOneById (id: ID): Option[ObjectType]

    Find an object by its ID.

    Find an object by its ID.

    id

    identifier

    returns

    (Option[ObjectType]) Some() of the object found, or None if no such object exists

    Attributes
    abstract
  6. def ids [A] (query: A)(implicit arg0: (A) ⇒ DBObject): List[ID]

    Queries for a list of identifiers.

    Queries for a list of identifiers.

    A

    type view bound to DBObject

    query

    query

    returns

    list of IDs

    Attributes
    abstract
  7. def insert (docs: Traversable[ObjectType], wc: WriteConcern): List[Option[ID]]

    docs

    collection of ObjectType instances to insert

    wc

    write concern

    returns

    list of object ids TODO: flatten list of IDs - why on earth didn't I do that in the first place?

    Attributes
    abstract
  8. def insert (t: ObjectType, wc: WriteConcern): Option[ID]

    Inserts a document into the database.

    Inserts a document into the database.

    t

    instance of ObjectType

    wc

    write concern

    returns

    if insert succeeds, ID of inserted object

    Attributes
    abstract
  9. def primitiveProjection [P] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): Option[P]

    Projection typed to a type for which Casbah or mongo-java-driver handles conversion

    Projection typed to a type for which Casbah or mongo-java-driver handles conversion

    P

    type of projected field

    query

    object for which to search

    field

    field to project on

    m

    implicit manifest typed to P

    ctx

    implicit Context

    returns

    (Option[P]) Some() of the object found, or None if no such object exists

    Attributes
    abstract
  10. def primitiveProjections [P] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): List[P]

    Projection typed to a type for which Casbah or mongo-java-driver handles conversion

    Projection typed to a type for which Casbah or mongo-java-driver handles conversion

    P

    type of projected field

    query

    object for which to search

    field

    field to project on

    m

    implicit manifest typed to P

    ctx

    implicit Context

    returns

    (List[P]) of the objects found

    Attributes
    abstract
  11. def projection [P <: CaseClass] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): Option[P]

    Projection typed to a case class, trait or abstract superclass.

    Projection typed to a case class, trait or abstract superclass.

    P

    type of projected field

    query

    object for which to search

    field

    field to project on

    m

    implicit manifest typed to P

    ctx

    implicit Context

    returns

    (Option[P]) Some() of the object found, or None if no such object exists

    Attributes
    abstract
  12. def projections [P <: CaseClass] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): List[P]

    Projection typed to a case class, trait or abstract superclass.

    Projection typed to a case class, trait or abstract superclass.

    P

    type of projected field

    query

    object for which to search

    field

    field to project on

    m

    implicit manifest typed to P

    ctx

    implicit Context

    returns

    (List[P]) of the objects found

    Attributes
    abstract
  13. def remove [A] (q: A, wc: WriteConcern)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Removes objects from the database collection.

    Removes objects from the database collection.

    q

    the object that documents to be removed must match

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Attributes
    abstract
  14. def remove (t: ObjectType, wc: WriteConcern): WriteResult

    Remove a matching object from the collection

    Remove a matching object from the collection

    t

    object to remove from the collection

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Attributes
    abstract
  15. def removeById (id: ID, wc: WriteConcern = defaultWriteConcern): WriteResult

    Remove document identified by this ID.

    Remove document identified by this ID.

    id

    the ID of the document to be removed

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Attributes
    abstract
  16. def removeByIds (ids: List[ID], wc: WriteConcern = defaultWriteConcern): WriteResult

    Remove documents matching any of the supplied list of IDs.

    Remove documents matching any of the supplied list of IDs.

    ids

    the list of IDs identifying the list of documents to be removed

    wc

    wrote concern

    returns

    (WriteResult) result of write operation

    Attributes
    abstract
  17. def save (t: ObjectType, wc: WriteConcern): WriteResult

    Saves an object to this collection.

    Saves an object to this collection.

    t

    object to save

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Attributes
    abstract
  18. def toDBObject (o: ObjectType): DBObject

    o

    object to transform

    returns

    object serialized as DBObject

    Attributes
    abstract
  19. def update (q: DBObject, o: DBObject, upsert: Boolean, multi: Boolean, wc: WriteConcern): WriteResult

    Performs an update operation.

    Performs an update operation.

    q

    search query for old object to update

    o

    object with which to update q

    upsert

    if the database should create the element if it does not exist

    multi

    if the update should be applied to all objects matching

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Attributes
    abstract

Concrete Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  9. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def find [A] (ref: A)(implicit arg0: (A) ⇒ DBObject): SalatMongoCursor[ObjectType]

    Queries for an object in this collection.

    Queries for an object in this collection.

    A

    type view bound to DBObject

    ref

    object for which to search

    returns

    a typed cursor to iterate over results

  12. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  13. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  14. def insert (docs: ObjectType*)(implicit wc: WriteConcern): List[Option[ID]]

    Inserts a group of documents into the database.

    Inserts a group of documents into the database.

    docs

    variable length argument of ObjectType instances

    returns

    if write concern succeeds, a list of object IDs TODO: this implicit: dumbest design decision on the face of the planet? TODO: replace vararg with traversable TODO: flatten list of IDs - why on earth didn't I do that in the first place?

  15. def insert (t: ObjectType): Option[ID]

    Inserts a document into the database.

    Inserts a document into the database.

    t

    instance of ObjectType

    returns

    if insert succeeds, ID of inserted object

  16. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  17. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  18. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  19. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  20. def remove [A] (q: A)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Removes objects from the database collection.

    Removes objects from the database collection.

    q

    the object that documents to be removed must match

    returns

    (WriteResult) result of write operation

  21. def remove (t: ObjectType): WriteResult

    Remove a matching object from the collection

    Remove a matching object from the collection

    t

    object to remove from the collection

    returns

    (WriteResult) result of write operation

  22. def save (t: ObjectType): WriteResult

    Saves an object to this collection.

    Saves an object to this collection.

    t

    object to save

    returns

    (WriteResult) result of write operation

  23. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  24. def toString (): String

    Definition Classes
    AnyRef → Any
  25. def update (q: DBObject, t: ObjectType, upsert: Boolean, multi: Boolean, wc: WriteConcern): WriteResult

    Performs an update operation.

    Performs an update operation.

    q

    search query for old object to update

    t

    object with which to update q

    upsert

    if the database should create the element if it does not exist

    multi

    if the update should be applied to all objects matching

    wc

    write concern

    returns

    (WriteResult) result of write operation

  26. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  28. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def findOneByID (id: ID): Option[ObjectType]

    Find an object by its ID.

    Find an object by its ID.

    id

    identifier

    returns

    (Option[ObjectType]) Some() of the object found, or None if no such object exists

    Annotations
    @deprecated
    Deprecated

    Use findOneById instead

Inherited from AnyRef

Inherited from Any