Skip to content

Instantly share code, notes, and snippets.

import WhileZ._
whileZ(somethting) {
println("!!!!")
doSomething()
}
object WhileZ {
def whileZ(b: =>Boolean)(u: Unit) =
@max-l
max-l / BasicCrud.scala
Created February 8, 2010 01:31
Squeryl usage demo
import org.squeryl.PrimitiveTypeMode._
import org.squeryl.{KeyedEntity, Schema}
class Artist(var name:String) extends MusicDbObject {
// this returns a Query[Song] which is also an Iterable[Song] :
def songs = from(MusicDb.songs)(s => where(s.artistId =? id) select(s))
def newSong(title: String, filePath: Option[String]) =
MusicDb.songs.insert(new Song(title, id, filePath))