Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
SCALA-2, SCALA-4, SCALA-6 - Refactored Type classes for Collection an…
Browse files Browse the repository at this point in the history
…d Cursor to minimize duplication and insanity
  • Loading branch information
Brendan W. McAdams committed Dec 23, 2010
1 parent e74a74a commit 63d8cd8
Show file tree
Hide file tree
Showing 6 changed files with 449 additions and 217 deletions.
8 changes: 4 additions & 4 deletions casbah-core/src/main/scala/Implicits.scala
Expand Up @@ -90,7 +90,7 @@ trait Implicits {
* Return a GENERIC Scala wrapper object for the DBCollection specific to a given Parameter type.
* @return MongoCollection[A<:DBObject] An instance of the scala wrapper containing the collection object.
*/
def asScalaTyped[A <: com.mongodb.DBObject](implicit m: scala.reflect.Manifest[A]) = new MongoCollection[A] { val underlying = coll }
def asScalaTyped[A <: com.mongodb.DBObject](implicit m: scala.reflect.Manifest[A]) = new MongoTypedCollection[A](coll)
}

/**
Expand All @@ -108,7 +108,7 @@ trait Implicits {
* Return a GENERIC Scala wrapper object for the DBCursor specific to a given Parameter type.
* @return MongoCursor[A<:DBObject] An instance of the scala wrapper containing the cursor object.
*/
def asScalaTyped[A <: com.mongodb.DBObject : Manifest] = new MongoCursor[A](cursor)
def asScalaTyped[A <: com.mongodb.DBObject : Manifest] = new MongoTypedCursor[A](cursor)
}

}
Expand All @@ -130,9 +130,9 @@ trait BaseImports {

trait TypeImports {
type MongoConnection = com.mongodb.casbah.MongoConnection
type MongoCollection = com.mongodb.casbah.MongoCollection[com.mongodb.DBObject]
type MongoCollection = com.mongodb.casbah.MongoCollection
type MongoDB = com.mongodb.casbah.MongoDB
type MongoCursor = com.mongodb.casbah.MongoCursor[com.mongodb.DBObject]
type MongoCursor = com.mongodb.casbah.MongoCursor
type MongoURI = com.mongodb.casbah.MongoURI
type MongoOptions = com.mongodb.MongoOptions
type WriteConcern = com.mongodb.WriteConcern
Expand Down

0 comments on commit 63d8cd8

Please sign in to comment.