Record-Squeryl

78 views
Skip to first unread message

Steven Yang

unread,
Jan 26, 2011, 5:39:22 AM1/26/11
to lif...@googlegroups.com
Hi

I have gone through most docs I can find for examples, including the two on http://www.assembla.com/wiki/show/liftweb/Squeryl

I cant get leftOuter to work for my Record with Squeryl.
I can get regular join to work no problem, even using "join()" instead of "from()". 

here is my code:

 def getAccessKeyAndStudentsOn() =
      join(KKSchema.accessKeys, KKSchema.students.leftOuter) ((ak, s) =>
        select(ak, s)
        on(ak.authKey === s.map(_.authKey)))

when I do this the compile gives:
[error] D:\scala\lift\src\main\scala\code\snippet\HelloWorld.scala:55: type mismatch;
[error]  found   : Option[net.liftweb.record.field.StringField[code.model.Student]]
[error]  required: org.squeryl.dsl.NonNumericalExpression[String]
[error]         on(ak.authKey === s.map(_.authKey)))
[error]                                               ^

if i try:

[error] D:\scala\lift\src\main\scala\code\snippet\HelloWorld.scala:55: type mismatch;
[error]  found   : Option[java.lang.String]
[error]  required: org.squeryl.dsl.NonNumericalExpression[String]
[error]         on(ak.authKey === s.map(_.authKey.is)))
[error]                                               ^

both points the .map part

I think this might be because an implicit function is not applied implicitly, but not sure.

Am I missing something?

Thanks

Michael Gottschalk

unread,
Jan 26, 2011, 9:14:19 AM1/26/11
to Lift
Hi Steven,

I think this is really a missing implicit conversion.
I have not yet used outer joins with squeryl-record and the test cases
do not cover them.

I'll try to reproduce it in the evening and will try to add the
missing conversion as soon as possible.

Can you open a ticket at http://ticket.liftweb.net (you must be a
watcher of the Liftweb assembla space to open tickets)?

Cheers,
Michael

On 26 Jan., 11:39, Steven Yang <kenshin...@gmail.com> wrote:
> Hi
>
> I have gone through most docs I can find for examples, including the two onhttp://www.assembla.com/wiki/show/liftweb/Squeryl

Michael Gottschalk

unread,
Jan 26, 2011, 5:33:38 PM1/26/11
to Lift
Hi Steven,

I already created the ticket myself and also fixed it:
https://www.assembla.com/spaces/liftweb/tickets/869-outer-joins-do-not-work-in-squeryl-record

There were indeed some implicit conversions missing.
I added them and verified with some unit tests that outer joins work
now.

The changes should be in the lift master within the next few days, so
that you get them if you use version 2.3-SNAPSHOT.

I also stumbled upon another bug in squeryl-record which I also fixed
(just in case you need many-to-many relations, too...):
https://www.assembla.com/spaces/liftweb/tickets/870-problems-with-manytomany-relations-in-squeryl-record

Cheers,
Michael

On 26 Jan., 15:14, Michael Gottschalk <migottsch...@googlemail.com>
wrote:
> Hi Steven,
>
> I think this is really a missing implicit conversion.
> I have not yet used outer joins with squeryl-record and the test cases
> do not cover them.
>
> I'll try to reproduce it in the evening and will try to add the
> missing conversion as soon as possible.
>
> Can you open a ticket athttp://ticket.liftweb.net(you must be a

Steven Yang

unread,
Jan 26, 2011, 9:12:31 PM1/26/11
to lif...@googlegroups.com
thanks a lot Micheal. 
Sorry I was in my dream while you fix the whole thing and opened the ticked, as I am in Taiwan. :)

I will switch to 2.3-SNAPSHOT and try it out.

Thanks

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.


Reply all
Reply to author
Forward
0 new messages