Hi Lukas, sorry for my late answer. Unfortunately I've been quite busy during the last days.
I suppose you already found out how the internals of case classes look like. Thanks for your great efforts and investigations! Hopefully I will find some time to get another look on scala and jOOQ the next days. If so, I will keep you posted. Maybe we we'll also see each other on the Vienna Scala & Database jOOQ special edition on April, 7th. Best regards, Florian On Mon, Mar 10, 2014 at 5:29 PM, Lukas Eder <[email protected]> wrote: > Hi Florian, > > I've been looking into the mapping of case classes... In fact, this is > already possible out of the box, if you > > - annotate those case classes with java.beans.ConstructorProperties > - have an exact match between fetched columns and case class fields > > Consider the following two queries: > > val books1 = > dsl().select(T_BOOK.ID, T_BOOK.AUTHOR_ID, T_BOOK.TITLE) > .from(T_BOOK) > .orderBy(T_BOOK.ID asc) > .fetchInto(classOf[BookCase]) > > println(books1); > > val books2 = > dsl().select() > .from(T_BOOK) > .orderBy(T_BOOK.ID asc) > .fetchInto(classOf[BookCaseWithConstructorProperties]) > > println(books2); > > > And these case classes: > > case class BookCase( > id: Int, > authorId: Int, > title: String) > > case class BookCaseWithConstructorProperties > @ConstructorProperties(Array("id", "authorId", "title")) ( > id: Int, > authorId: Int, > title: String) > > > Cheers, Lukas > > -- > You received this message because you are subscribed to a topic in the > Google Groups "jOOQ User Group" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/jooq-user/IQ4j8glws9s/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
