I am reading a tutorial via the following URL: http://www.smartjava.org/content/tutorial-getting-started-scala-and-scalatra-part-iii
Here's a snippet of code:
class BidRepository extends RepositoryBase {
object BidMapping extends Table[(Option[Long], Long, Double, Double, String, Long, Long)]("sc_bid") {
def id = column[Option[Long]]("id", O PrimaryKey)
def forItem = column[Long]("for", O NotNull)
def min = column[Double]("min", O NotNull)
def max = column[Double]("max", O NotNull)
def currency = column[String]("currency")
def bidder = column[Long]("bidder", O NotNull)
def date = column[Long]("date", O NotNull)
def noID = forItem ~ min ~ max ~ currency ~ bidder ~ date
def * = id ~ forItem ~ min ~ max ~ currency ~ bidder ~ date
}
What I'm failing to grok here is what ~
is being used for here? What exactly is happening when the noID
and *
methods are invoked? Is there enough context here to understand, or is ~
some implicit value that I'm not seeing somewhere?