Message from discussion
Case classes and Scalaquery
Received: by 10.52.23.146 with SMTP id m18mr41312648vdf.7.1335906611364;
Tue, 01 May 2012 14:10:11 -0700 (PDT)
X-BeenThere: scalaquery@googlegroups.com
Received: by 10.220.142.13 with SMTP id o13ls2409331vcu.0.gmail; Tue, 01 May
2012 14:09:59 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.52.23.211 with SMTP id o19mr714911vdf.6.1335906599469; Tue, 01
May 2012 14:09:59 -0700 (PDT)
Authentication-Results: ls.google.com; spf=pass (google.com: domain of
sit1...@gmail.com designates internal as permitted sender)
smtp.mail=sit1...@gmail.com; dkim=pass
header...@gmail.com
Received: by w5g2000vbp.googlegroups.com with HTTP; Tue, 1 May 2012 14:09:59
-0700 (PDT)
Date: Tue, 1 May 2012 14:09:59 -0700 (PDT)
In-Reply-To: <CAM-vFRyW_S+j4qTDJ45YuZ4sfa5aeieQPzTfGRVcacxGQON3Gg@mail.gmail.com>
References: <CAM-vFRyW_S+j4qTDJ45YuZ4sfa5aeieQPzTfGRVcacxGQON3Gg@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2,gzip(gfe)
Message-ID: <6613f6ed-9dc3-4274-b7c5-c1ce82bd9cbe@w5g2000vbp.googlegroups.com>
Subject: Re: Case classes and Scalaquery
From: virtualeyes <sit1...@gmail.com>
To: ScalaQuery <scalaquery@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Sure, don't use tuples, or, if your reason for using tuples is to grab
only a subset of case class fields, then create a case class
"projection" based on those fields
That way you are always working with sensible objects and
never ._1, ._2 madness ;-)
I think you can have your cake (object) and eat it (ScalaQuery
goodness) too. Of course, that's just how I do it, I'm sure there are
more advanced developers that have a solution for what you're
describing.
On May 1, 10:12=A0pm, Edmondo Porcu <edmondo.po...@gmail.com> wrote:
> Dear ScalaQuery users,
> is there a simple way to turn a case class into a tuple and viceversa
> to avoid boilerplate code when inserting or querying a db with
> scalaquery?
>
> Best Regards