Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Salat type parameters
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Slinn  
View profile  
 More options Jul 11 2012, 1:52 pm
From: Michael Slinn <msl...@gmail.com>
Date: Wed, 11 Jul 2012 10:52:08 -0700 (PDT)
Local: Wed, Jul 11 2012 1:52 pm
Subject: Salat type parameters

We are getting inconsistent results using Salat 0.08, Scala 2.9.1 and SBT
0.11.3 on various computers. Here is one of the DOA definitions, defined in
a trait called BooksCollection:

class BooksDAO extends SalatDAO[Book, String](collection = booksCollection)

Here is the problem statement:

booksDAO.update[MongoDBObject](MongoDBObject(CommonAttrs.ID -> b.id), b,
true, false, WriteConcern.Safe)

On Mac Snow Leopard, the code compiles fine.
On Linux 11.04, we get:

[error] /blah/src/main/scala/com/blah/mongo/DomainCollections.scala:89:
overloaded method value update with alternatives:
[error]   (q: com.mongodb.DBObject,o: com.mongodb.DBObject,upsert:
Boolean,multi: Boolean,wc: com.mongodb.WriteConcern)Unit <and>
[error]   (q: com.mongodb.DBObject,t: com.bookish.domain.Book,upsert:
Boolean,multi: Boolean,wc: com.mongodb.WriteConcern)Unit
[error]  does not take type parameters
[error]   def upsertBook(b: Book) = booksDAO.update[MongoDBObject](MongoDBObject(CommonAttrs.ID
-> b.id), b, true, false, WriteConcern.Safe)

If we remove [MongoDBObject], the code now compiles fine on Linux but not
Mac. The error on Mac is:

error: ambiguous reference to overloaded definition,
both method update in class SalatDAO of type [A, B](q: A, o: B, upsert:
Boolean, multi: Boolean, wc: com.mongodb.WriteConcern)(implicit evidence$6:
A => com.mongodb.DBObject, implicit evidence$7: B =>
com.mongodb.DBObject)Unit
and  method update in trait BaseDAOMethods of type [A](q: A, t:
com.blah.Book, upsert: Boolean, multi: Boolean, wc:
com.mongodb.WriteConcern)(implicit evidence$8: A =>
com.mongodb.DBObject)Unit
match argument types
(com.mongodb.casbah.commons.Imports.DBObject,com.blah.Book,Boolean,Boolean, com.mongodb.WriteConcern)
booksDAO.update(MongoDBObject(CommonAttrs.ID -> b.id), b, true, false,
WriteConcern.Safe)

Suggestions as to what the root problem is, and how to solve?

Mike


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Slinn  
View profile  
 More options Jul 11 2012, 3:25 pm
From: Michael Slinn <msl...@gmail.com>
Date: Wed, 11 Jul 2012 12:25:48 -0700 (PDT)
Local: Wed, Jul 11 2012 3:25 pm
Subject: Re: Salat type parameters

I used named parameters and the problem went away. Seems v0.8.0 did not
solve that issue.

Mike


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »