Squeryl-record Calendar query
I just updated from Lift 2.2 to 2.3-M1 to fix #869, which appears to
have fixed the bug. Unfortunately, the upgrade broke querying by date.
// crontask.scala
class CronTask extends Record[CronTask] with KeyedRecord[Long] {
override def meta = CronTask
@Column(name="id")
override val idField = new LongField(this)
val last_ran = new DateTimeField(this)
}
object CronTask extends CronTask with MetaRecord[CronTask]
// elsewhere
from(Schema.crontasks)(c =>
where (c.last_run < Calendar.getInstance.getTime)
select (c))
// compiler error
[error] found : java.util.Date
[error] required:
org.squeryl.dsl.NonNumericalExpression[java.sql.Timestamp]
[error] where (c.last_ran < Calendar.getInstance.getTime)
[error] ^ (under getTime)
have fixed the bug. Unfortunately, the upgrade broke querying by date.
// crontask.scala
class CronTask extends Record[CronTask] with KeyedRecord[Long] {
override def meta = CronTask
@Column(name="id")
override val idField = new LongField(this)
val last_ran = new DateTimeField(this)
}
object CronTask extends CronTask with MetaRecord[CronTask]
// elsewhere
from(Schema.crontasks)(c =>
where (c.last_run < Calendar.getInstance.getTime)
select (c))
// compiler error
[error] found : java.util.Date
[error] required:
org.squeryl.dsl.NonNumericalExpression[java.sql.Timestamp]
[error] where (c.last_ran < Calendar.getInstance.getTime)
[error] ^ (under getTime)
Leave a comment