0

I want to identify a user using the Google OAuth service. This returns a googleId which is 2^67 so it does not fit into the long datatype which I am currently using as the primary key in my table. Because of this I wanted to store the googleId in a StringField.

However, this does not function because I can not get the Where clause working: where(u.googleId.is === id)
produces the error value === is not a member of u.googleId.MyType.

I defined it like this:

val googleId = new StringField(this, "")

How can I select the data using a StringField in the where clause?

Thanks in advance

Flo

Flo
  • 310
  • 1
  • 6

2 Answers2

0

Doesn't BigDecimal do the trick? http://squeryl.org/schema-definition.html

Also, I'm not sure about the syntax, isn't it supposed to be ?:

where(u.googleId == "hello there")

I'm using pure squeryl and pure liftweb, so I'm not sure..

VasiliNovikov
  • 9,681
  • 4
  • 44
  • 62
0

I solved it by importing org.squeryl.PrimitiveTypeMode._ as described here Squeryl Schema Definition

I then set the googleId to be of type StringField

val googleId = new StringField(this,"")

Now I have to add a .~ to the field because else it will be interpreted as String not as TypedExpressionNode[Int].

Now the following statement works:

where(u.googleId.is.~ === id) select (u))
Flo
  • 310
  • 1
  • 6