Hello, I just started playing with Slick, and it is indeed very cool :-D

However, I am puzzled by this behavior...

I have a table of accountID and accountRoleTypeID

    class AccountRoleTypeMatch(tag: Tag) extends Table[(Int,Int)](tag, 
"AccountRoleTypeMatch") {
      def accountID: Column[Int] = column[Int]("AccountID", O.PrimaryKey)
      def accountRoleTypeID: Column[Int] = column[Int]("AccountRoleTypeID")

      def * : ProvenShape[(Int, Int)] = (accountID, accountRoleTypeID)
   }

And I want to retrieve the accountIDs with accountRoleTypeID == 21

      val accountRoleTypeMatchs: TableQuery[AccountRoleTypeMatch] = 
TableQuery[AccountRoleTypeMatch]
      val premiumAccountIDs = accountRoleTypeMatchs.filter( 
_.accountRoleTypeID == 21 )

      premiumAccountIDs.list.foreach {
        case (accountID, accountRoleTypeID) =>
          println(accountID + "  " + accountRoleTypeID)
      }

But it generates this select, and I get nothing

    select x2.`AccountID`, x2.`AccountRoleTypeID` from 
`AccountRoleTypeMatch` x2 where false

If I change the filter to 

      val premiumAccountIDs = accountRoleTypeMatchs.filter( 
_.accountRoleTypeID < 21 )

Then it works as expected

      select x2.`AccountID`, x2.`AccountRoleTypeID` from 
`AccountRoleTypeMatch` x2 where x2.`AccountRoleTypeID` < 21

What is going on?  How should I filter to get only rows with 
accountRoleTypeID==21?

Thanks
Peter

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to