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

Commit

Permalink
Merge branch 'master' into 0.0.8_2.9.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
rktoomey committed Jun 24, 2012
2 parents ac5bcbd + f22de0e commit 1a1ada9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
9 changes: 3 additions & 6 deletions salat-core/src/main/scala/com/novus/salat/dao/DAO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,18 @@ trait BaseDAOMethods[ObjectType <: AnyRef, ID <: Any] {
* @param upsert if the database should create the element if it does not exist
* @param multi if the update should be applied to all objects matching
* @param wc write concern
* @tparam A type view bound to DBObject
* @tparam B type view bound to DBObject
*/
def update[A <% DBObject, B <% DBObject](q: A, o: B, upsert: Boolean, multi: Boolean, wc: WriteConcern)
def update(q: DBObject, o: DBObject, upsert: Boolean, multi: Boolean, wc: WriteConcern)

/** Performs an update operation.
* @param q search query for old object to update
* @param t object with which to update <tt>q</tt>
* @param upsert if the database should create the element if it does not exist
* @param multi if the update should be applied to all objects matching
* @param wc write concern
* @tparam A type view bound to DBObject
*/
def update[A <% DBObject](q: A, t: ObjectType, upsert: Boolean, multi: Boolean, wc: WriteConcern) {
update(q, toDBObject(t), upsert, multi, wc)
def update(q: DBObject, t: ObjectType, upsert: Boolean, multi: Boolean, wc: WriteConcern) {
update(q = q, o = toDBObject(t), upsert = upsert, multi = multi, wc = wc)
}

/** Remove a matching object from the collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ trait ModelCompanion[ObjectType <: AnyRef, ID <: Any] extends BaseDAOMethods[Obj
dao.save(t, wc)
}

def update[A <% DBObject, B <% DBObject](q: A, o: B, upsert: Boolean, multi: Boolean, wc: WriteConcern = defaultWriteConcern) {
def update(q: DBObject, o: DBObject, upsert: Boolean, multi: Boolean, wc: WriteConcern = defaultWriteConcern) {
dao.update(q, o, upsert, multi, wc)
}

Expand Down
4 changes: 1 addition & 3 deletions salat-core/src/main/scala/com/novus/salat/dao/SalatDAO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,8 @@ abstract class SalatDAO[ObjectType <: AnyRef, ID <: Any](val collection: MongoCo
* @param upsert if the database should create the element if it does not exist
* @param multi if the update should be applied to all objects matching
* @param wc write concern
* @tparam A type view bound to DBObject
* @tparam B type view bound to DBObject
*/
def update[A <% DBObject, B <% DBObject](q: A, o: B, upsert: Boolean = false, multi: Boolean = false, wc: WriteConcern = defaultWriteConcern) {
def update(q: DBObject, o: DBObject, upsert: Boolean = false, multi: Boolean = false, wc: WriteConcern = defaultWriteConcern) {
try {
val wr = collection.update(q, o, upsert, multi, wc)
val lastError = wr.getCachedLastError
Expand Down

0 comments on commit 1a1ada9

Please sign in to comment.