Skip to content

Commit

Permalink
0.5.1: Don't use cast (asColumnOf) in EntTableQuery#lookup; add Entit…
Browse files Browse the repository at this point in the history
…yTable#lookup
  • Loading branch information
nafg committed Aug 9, 2016
1 parent 79f9823 commit 7df0491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/scala/slick/additions/KeyedTableComponent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ trait KeyedTableComponent extends JdbcDriver {
key ~: mapping

def * = all

def lookup(implicit lt: TypedType[Lookup[K, V]]): Rep[Lookup[K, V]] =
column[Lookup[K, V]](keyColumnName, keyColumnOptions: _*)
}

class KeyedTableQueryBase[K : BaseColumnType, A, T <: KeyedTable[K, A]](cons: Tag => (T with KeyedTable[K, A])) extends TableQuery[T](cons) {
Expand Down Expand Up @@ -215,7 +218,7 @@ trait KeyedTableComponent extends JdbcDriver {

override def lookupQuery(lookup: Lookup) = this.filter(_.key === lookup.key)
override def lookupValue(a: KeyedEntity[K, V]) = a.value
val lookup: T => Rep[Lookup] = t => t.key.asColumnOf[Lookup]
val lookup: T => Rep[Lookup] = _.lookup

trait LookupLens[L] {
/**
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "0.5.0"
version in ThisBuild := "0.5.1"

0 comments on commit 7df0491

Please sign in to comment.