Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SCALA-70: Removed type alias to com.mongodb.WriteConcern and made met…

…hod args for it explicit, as it was causing a fun post-compile (aka "library compiles, user code doesn't") implosion.
  • Loading branch information...
commit 356600e0ac501d68e77b059faeb1eac3325622ee 1 parent d768bc3
@bwmcadams bwmcadams authored
View
1  casbah-core/src/main/scala/Implicits.scala
@@ -152,7 +152,6 @@ trait BaseImports {
trait TypeImports {
type MongoOptions = com.mongodb.MongoOptions
- type WriteConcern = com.mongodb.WriteConcern
type LazyDBObject = com.mongodb.LazyDBObject
type ReadPreference = com.mongodb.ReadPreference
type WriteResult = com.mongodb.WriteResult
View
40 casbah-core/src/main/scala/MongoCollection.scala
@@ -306,7 +306,7 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
*
* @throws MongoException
*/
- @deprecated("Pass WriteConcern to write ops instead for single op safety.")
+ @deprecated("Pass com.mongodb.WriteConcern to write ops instead for single op safety.")
def request(op: this.type => WriteResult) = {
op(this).getLastError.throwOnError
}
@@ -327,7 +327,7 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
*
* @throws MongoException
*/
- @deprecated("Pass WriteConcern to write ops instead for single op safety.")
+ @deprecated("Pass com.mongodb.WriteConcern to write ops instead for single op safety.")
def request(w: Int, wTimeout: Int = 0, fsync: Boolean = false)(op: this.type => WriteResult) =
op(this).getLastError(WriteConcern(w, wTimeout, fsync)).throwOnError
@@ -347,8 +347,8 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
*
* @throws MongoException
*/
- @deprecated("Pass WriteConcern to write ops instead for single op safety.")
- def request(concern: WriteConcern)(op: this.type => WriteResult) =
+ @deprecated("Pass com.mongodb.WriteConcern to write ops instead for single op safety.")
+ def request(concern: com.mongodb.WriteConcern)(op: this.type => WriteResult) =
op(this).getLastError(concern).throwOnError
/** Find a collection that is prefixed with this collection's name.
@@ -483,7 +483,7 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
* @dochub insert
* TODO - Wrapper for WriteResult?
*/
- def insert[A](docs: A*)(implicit dbObjView: A => DBObject, concern: WriteConcern = writeConcern, encoder: DBEncoder = customEncoderFactory.map(_.create).orNull ): WriteResult = {
+ def insert[A](docs: A*)(implicit dbObjView: A => DBObject, concern: com.mongodb.WriteConcern = writeConcern, encoder: DBEncoder = customEncoderFactory.map(_.create).orNull ): WriteResult = {
val b = new scala.collection.mutable.ArrayBuilder.ofRef[DBObject]
b.sizeHint(docs.size)
for (x <- docs) b += dbObjView(x)
@@ -522,7 +522,7 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
* @dochub remove
* TODO - Wrapper for WriteResult?
*/
- def remove[A](o: A)(implicit dbObjView: A => DBObject, concern: WriteConcern = getWriteConcern, encoder: DBEncoder = customEncoderFactory.map(_.create).orNull ) =
+ def remove[A](o: A)(implicit dbObjView: A => DBObject, concern: com.mongodb.WriteConcern = getWriteConcern, encoder: DBEncoder = customEncoderFactory.map(_.create).orNull ) =
underlying.remove(dbObjView(o), concern, encoder)
/** Clears all indices that have not yet been applied to this collection. */
@@ -533,7 +533,7 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
* will add <code>_id</code> field to o if needed
* TODO - Wrapper for WriteResult?
*/
- def save[A](o: A)(implicit dbObjView: A => DBObject, concern: WriteConcern = writeConcern) = underlying.save(dbObjView(o), writeConcern)
+ def save[A](o: A)(implicit dbObjView: A => DBObject, concern: com.mongodb.WriteConcern = writeConcern) = underlying.save(dbObjView(o), writeConcern)
/** Set hint fields for this collection.
@@ -566,7 +566,7 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
* @dochub update
* TODO - Wrapper for WriteResult?
*/
- def update[A, B](q: A, o: B, upsert: Boolean = false, multi: Boolean = false)(implicit queryView: A => DBObject, objView: B => DBObject, concern: WriteConcern = this.writeConcern, encoder: DBEncoder = customEncoderFactory.map(_.create).orNull ) =
+ def update[A, B](q: A, o: B, upsert: Boolean = false, multi: Boolean = false)(implicit queryView: A => DBObject, objView: B => DBObject, concern: com.mongodb.WriteConcern = this.writeConcern, encoder: DBEncoder = customEncoderFactory.map(_.create).orNull ) =
underlying.update(queryView(q), objView(o), upsert, multi, concern, encoder)
@@ -611,9 +611,9 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
*/
def getLastError() = getDB.getLastError
def lastError() = getLastError()
- def getLastError(concern: WriteConcern) =
+ def getLastError(concern: com.mongodb.WriteConcern) =
getDB.getLastError(concern)
- def lastError(concern: WriteConcern) =
+ def lastError(concern: com.mongodb.WriteConcern) =
getLastError(concern)
def getLastError(w: Int, wTimeout: Int, fsync: Boolean) =
getDB.getLastError(w, wTimeout, fsync)
@@ -638,33 +638,33 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
*
* Set the write concern for this database.
* Will be used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @param concern (WriteConcern) The write concern to use
- * @see WriteConcern
+ * @param concern (com.mongodb.WriteConcern) The write concern to use
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
- def setWriteConcern(concern: WriteConcern) = underlying.setWriteConcern(concern)
+ def setWriteConcern(concern: com.mongodb.WriteConcern) = underlying.setWriteConcern(concern)
/**
*
* Set the write concern for this database.
* Will be used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
* @param concern (WriteConcern) The write concern to use
* @see WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
- def writeConcern_=(concern: WriteConcern) = setWriteConcern(concern)
+ def writeConcern_=(concern: com.mongodb.WriteConcern) = setWriteConcern(concern)
/**
*
* get the write concern for this database,
* which is used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @see WriteConcern
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
def getWriteConcern = underlying.getWriteConcern()
@@ -673,9 +673,9 @@ abstract class MongoCollection extends Logging with Iterable[DBObject] {
*
* get the write concern for this database,
* which is used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @see WriteConcern
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
def writeConcern = getWriteConcern
View
22 casbah-core/src/main/scala/MongoConnection.scala
@@ -266,31 +266,31 @@ class MongoConnection(val underlying: com.mongodb.Mongo) {
* Will be used for writes to any collection in this database.
* See the documentation for {@link WriteConcern} for more info.
*
- * @param concern (WriteConcern) The write concern to use
- * @see WriteConcern
+ * @param concern (com.mongodb.WriteConcern) The write concern to use
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
- def setWriteConcern(concern: WriteConcern) = underlying.setWriteConcern(concern)
+ def setWriteConcern(concern: com.mongodb.WriteConcern) = underlying.setWriteConcern(concern)
/**
*
* Set the write concern for this database.
* Will be used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @param concern (WriteConcern) The write concern to use
- * @see WriteConcern
+ * @param concern (com.mongodb.WriteConcern) The write concern to use
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
- def writeConcern_=(concern: WriteConcern) = setWriteConcern(concern)
+ def writeConcern_=(concern: com.mongodb.WriteConcern) = setWriteConcern(concern)
/**
*
* get the write concern for this database,
* which is used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @see WriteConcern
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
def getWriteConcern = underlying.getWriteConcern
@@ -299,9 +299,9 @@ class MongoConnection(val underlying: com.mongodb.Mongo) {
*
* get the write concern for this database,
* which is used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @see WriteConcern
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
def writeConcern = getWriteConcern
View
32 casbah-core/src/main/scala/MongoDB.scala
@@ -151,9 +151,9 @@ class MongoDB(val underlying: com.mongodb.DB) {
*/
def getLastError() = underlying.getLastError
def lastError() = getLastError()
- def getLastError(writeConcern: WriteConcern) =
+ def getLastError(writeConcern: com.mongodb.WriteConcern) =
underlying.getLastError(writeConcern)
- def lastError(writeConcern: WriteConcern) =
+ def lastError(writeConcern: com.mongodb.WriteConcern) =
getLastError(writeConcern)
def getLastError(w: Int, wTimeout: Int, fsync: Boolean) =
underlying.getLastError(w, wTimeout, fsync)
@@ -230,33 +230,33 @@ class MongoDB(val underlying: com.mongodb.DB) {
*
* Set the write concern for this database.
* Will be used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @param concern (WriteConcern) The write concern to use
- * @see WriteConcern
+ * @param concern (com.mongodb.WriteConcern) The write concern to use
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
- def setWriteConcern(concern: WriteConcern) = underlying.setWriteConcern(concern)
+ def setWriteConcern(concern: com.mongodb.WriteConcern) = underlying.setWriteConcern(concern)
/**
*
* Set the write concern for this database.
* Will be used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @param concern (WriteConcern) The write concern to use
- * @see WriteConcern
+ * @param concern (com.mongodb.WriteConcern) The write concern to use
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
- def writeConcern_=(concern: WriteConcern) = setWriteConcern(concern)
+ def writeConcern_=(concern: com.mongodb.WriteConcern) = setWriteConcern(concern)
/**
*
* get the write concern for this database,
* which is used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @see WriteConcern
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
def getWriteConcern = underlying.getWriteConcern()
@@ -265,9 +265,9 @@ class MongoDB(val underlying: com.mongodb.DB) {
*
* get the write concern for this database,
* which is used for writes to any collection in this database.
- * See the documentation for {@link WriteConcern} for more info.
+ * See the documentation for {@link com.mongodb.WriteConcern} for more info.
*
- * @see WriteConcern
+ * @see com.mongodb.WriteConcern
* @see http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/
*/
def writeConcern = getWriteConcern
@@ -342,7 +342,7 @@ class MongoDB(val underlying: com.mongodb.DB) {
* Your function must return WriteResult, which is the
* return type of any mongo write operation like insert/save/update/remove
*
- * If you have set a connection or DB level WriteConcern,
+ * If you have set a connection or DB level com.mongodb.WriteConcern,
* it will be inherited.
*
* @throws MongoException
@@ -385,7 +385,7 @@ class MongoDB(val underlying: com.mongodb.DB) {
*
* @throws MongoException
*/
- def request(writeConcern: WriteConcern)(op: MongoDB => WriteResult) =
+ def request(writeConcern: com.mongodb.WriteConcern)(op: MongoDB => WriteResult) =
op(this).getLastError(writeConcern).throwOnError
def checkedWrite(op: MongoDB => WriteResult) =
View
2  project/CasbahBuild.scala
@@ -6,7 +6,7 @@ object CasbahBuild extends Build {
import Resolvers._
lazy val buildSettings = Seq(
- organization := "com.mongodb.casbah",
+ organization := "org.mongodb",
version := "3.0.0-M1",
crossScalaVersions := Seq("2.9.1", "2.9.0-1", "2.9.0", "2.8.1")
)
Please sign in to comment.
Something went wrong with that request. Please try again.