Outer Joins do not work in Squeryl-Record
Some implicit conversions are missing for dealing with outer joins.
Example:
def getAccessKeyAndStudentsOn() =
join(KKSchema.accessKeys, KKSchema.students.leftOuter) ((ak, s) =>
select(ak, s)
on(ak.authKey === s.map(_.authKey)))
[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] ^
Reported in this thread:
http://groups.google.com/group/liftweb/browse_thread/thread/ba423af7b40daa6f/a1356d902ed1af19#a1356d902ed1af19
There need to be implicit conversions for Option[TypedField[T]] to NonNumericalExpression[T] or NumericalExpression[Option[T]], depending on the type.
Example:
def getAccessKeyAndStudentsOn() =
join(KKSchema.accessKeys, KKSchema.students.leftOuter) ((ak, s) =>
select(ak, s)
on(ak.authKey === s.map(_.authKey)))
[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] ^
Reported in this thread:
http://groups.google.com/group/liftweb/browse_thread/thread/ba423af7b40daa6f/a1356d902ed1af19#a1356d902ed1af19
There need to be implicit conversions for Option[TypedField[T]] to NonNumericalExpression[T] or NumericalExpression[Option[T]], depending on the type.
Leave a comment
on 2011-01-27 09:32 *
By Anonymous
Status changed from Accepted to Fixed
Work remaining changed from 1.0 to 0.0
(In revision:09038652c7ec322c85796daa4fd0ba7145796451) Fixed ManyToMany relations and outer joins in Squeryl-Record
Closes #869
Closes #870
ManyToMany relations can now be expressed with relation tables of POSO objects.
For relation tables, no record should be needed. It is now also possible to mix
records and POSOs for tables belonging to one project.
For outer joins, implicit conversions of Option[TypedField[T]] to
NumericalExpression[Option[T]]/NonNumericalExpression[T] were added.
Unit tests now include test cases for ManyToMany relations and outer joins.
Branch: master
Closes #869
Closes #870
ManyToMany relations can now be expressed with relation tables of POSO objects.
For relation tables, no record should be needed. It is now also possible to mix
records and POSOs for tables belonging to one project.
For outer joins, implicit conversions of Option[TypedField[T]] to
NumericalExpression[Option[T]]/NonNumericalExpression[T] were added.
Unit tests now include test cases for ManyToMany relations and outer joins.
Branch: master