com.novus.salat.dao

ValidatingSalatDAO

class ValidatingSalatDAO [ObjectType <: AnyRef, ID] extends SalatDAO[ObjectType, ID]

Attributes
abstract
Linear Supertypes
SalatDAO[ObjectType, ID], Logging, DAO[ObjectType, ID], BaseDAOMethods[ObjectType, ID], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ValidatingSalatDAO
  2. SalatDAO
  3. Logging
  4. DAO
  5. BaseDAOMethods
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ValidatingSalatDAO (collection: MongoCollection)(implicit mot: Manifest[ObjectType], mid: Manifest[ID], ctx: Context)

Type Members

  1. class ChildCollection [ChildType <: AnyRef, ChildID] extends SalatDAO[ChildType, ChildID]

    Inner abstract class to facilitate working with child collections using a typed parent id - no cascading support will be offered, but you can override saves and deletes in the parent DAO to manually cascade children as you like.

Abstract Value Members

  1. def validators : List[(ObjectType) ⇒ Either[Throwable, ObjectType]]

    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. val _grater : Grater[ObjectType]

    Supplies the Grater from the implicit Context and ObjectType manifest

    Supplies the Grater from the implicit Context and ObjectType manifest

    returns

    Grater to serialize and deserialize ObjectType

    Definition Classes
    SalatDAODAO
  7. val appendTypeHintToQueries : Boolean

    If you are mixing and matching abstract and concrete DAOs, turn this on in the concrete DAOs to ensure that querying on a mixed collection will only yield results in the child collection.

    If you are mixing and matching abstract and concrete DAOs, turn this on in the concrete DAOs to ensure that querying on a mixed collection will only yield results in the child collection.

    Definition Classes
    SalatDAO
  8. def asInstanceOf [T0] : T0

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. val collection : MongoCollection

    returns

    MongoDB collection

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

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  12. def decorateDBO (toPersist: ObjectType): DBObject

    A central place to modify DBOs before inserting, saving, or updating.

    A central place to modify DBOs before inserting, saving, or updating.

    toPersist

    object to be serialized

    returns

    decorated DBO for persisting

    Definition Classes
    SalatDAO
  13. def decorateQuery (query: DBObject): DBObject

    A central place to modify find, count and update queries before executing them.

    A central place to modify find, count and update queries before executing them.

    query

    query to decorate

    returns

    decorated query for execution

    Definition Classes
    SalatDAO
  14. 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

    Definition Classes
    DAOBaseDAOMethods
  15. lazy val description : String

    Definition Classes
    ValidatingSalatDAOSalatDAODAO
  16. def eq (arg0: AnyRef): Boolean

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

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

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

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  20. 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

    Definition Classes
    BaseDAOMethods
  21. def findOne [A] (t: A)(implicit arg0: (A) ⇒ DBObject): Option[ObjectType]

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  22. def findOneById (id: ID): Option[ObjectType]

    id

    identifier

    returns

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

    Definition Classes
    SalatDAOBaseDAOMethods
  23. val forceTypeHints : Boolean

    Force type hints when objects are persisted.

    Force type hints when objects are persisted. Used to support a DAO typed to an abstract superclass or trait. Should be overriden and forced to true when you want to select

    Definition Classes
    SalatDAO
  24. def getClass (): java.lang.Class[_]

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

    Definition Classes
    AnyRef → Any
  26. def ids [A] (query: A)(implicit arg0: (A) ⇒ DBObject): List[ID]

    A

    type view bound to DBObject

    query

    query

    returns

    list of IDs

    Definition Classes
    SalatDAOBaseDAOMethods
  27. 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?

    Definition Classes
    ValidatingSalatDAOSalatDAOBaseDAOMethods
  28. def insert (t: ObjectType, wc: WriteConcern): Option[ID]

    t

    instance of ObjectType

    wc

    write concern

    returns

    if insert succeeds, ID of inserted object

    Definition Classes
    ValidatingSalatDAOSalatDAOBaseDAOMethods
  29. 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?

    Definition Classes
    BaseDAOMethods
  30. 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

    Definition Classes
    BaseDAOMethods
  31. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  32. var log : Logger

    Attributes
    protected[casbah]
    Definition Classes
    Logging
  33. def ne (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  36. def primitiveProjection [P] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): Option[P]

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  37. def primitiveProjections [P] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): List[P]

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  38. def projection [P <: CaseClass] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): Option[P]

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  39. def projections [P <: CaseClass] (query: DBObject, field: String)(implicit m: Manifest[P], ctx: Context): List[P]

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  40. def remove [A] (q: A, wc: WriteConcern)(implicit arg0: (A) ⇒ DBObject): WriteResult

    q

    the object that documents to be removed must match

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Definition Classes
    SalatDAOBaseDAOMethods
  41. def remove (t: ObjectType, wc: WriteConcern): WriteResult

    t

    object to remove from the collection

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Definition Classes
    SalatDAOBaseDAOMethods
  42. 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

    Definition Classes
    BaseDAOMethods
  43. 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

    Definition Classes
    BaseDAOMethods
  44. def removeById (id: ID, wc: WriteConcern = defaultWriteConcern): WriteResult

    id

    the ID of the document to be removed

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Definition Classes
    SalatDAOBaseDAOMethods
  45. def removeByIds (ids: List[ID], wc: WriteConcern): WriteResult

    ids

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

    wc

    wrote concern

    returns

    (WriteResult) result of write operation

    Definition Classes
    SalatDAOBaseDAOMethods
  46. def save (t: ObjectType, wc: WriteConcern): WriteResult

    t

    object to save

    wc

    write concern

    returns

    (WriteResult) result of write operation

    Definition Classes
    ValidatingSalatDAOSalatDAOBaseDAOMethods
  47. 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

    Definition Classes
    BaseDAOMethods
  48. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  49. def toDBObject (o: ObjectType): DBObject

    o

    object to transform

    returns

    object serialized as DBObject

    Definition Classes
    DAOBaseDAOMethods
  50. def toString (): String

    Definition Classes
    AnyRef → Any
  51. 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

    Definition Classes
    ValidatingSalatDAOBaseDAOMethods
  52. def update (q: DBObject, o: DBObject, upsert: Boolean = false, multi: Boolean = false, wc: WriteConcern = defaultWriteConcern): WriteResult

    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

    Definition Classes
    SalatDAOBaseDAOMethods
  53. object validates extends Validates[ObjectType]

  54. def wait (): Unit

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  56. 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

    Definition Classes
    BaseDAOMethods
    Annotations
    @deprecated
    Deprecated

    Use findOneById instead

Inherited from SalatDAO[ObjectType, ID]

Inherited from Logging

Inherited from DAO[ObjectType, ID]

Inherited from BaseDAOMethods[ObjectType, ID]

Inherited from AnyRef

Inherited from Any