I'm fairly new to Scala and currently using an ORM called Squeryl against our MySQL database.
What I'm trying to do is looking up plural records that fall within a time range. For example, in plain SQL, I think it would be something like:
SELECT * FROM records WHERE updated_at >= ? AND updated_at < ?
However, my Scala code to achieve similar behavior as below, gives me an error saying "java.util.Date does not take parameters" at the opening bracket in "from(records)"
def getRecordsBetween(from:java.util.Date, til:java.util.Date):List[Record]
transaction {
from(records)(record =>
where(
record.updatedAt gte from and
record.updatedAt lt til
)
select(record)
).toList
}
}
(where val records = tableRecord
What am I doing wrong here? Thanks a lot in advance.