[2.0] spanM still part of Anorm?

Showing 1-3 of 3 messages
[2.0] spanM still part of Anorm? Ike 3/11/12 10:25 AM
Hi all,

I can't find any references in the current documentation of in the sample apps for Anorm parsers that span multiple rows.For example, if I have an order/order-line-item relationship, and I do a join query that returns multiple rows per per order (one row for each order line item), what's the proper way to parse this with Anorm in 2.0?

order ~ spanM(orderDetail)

??
Re: [play-framework] [2.0] spanM still part of Anorm? Guillaume Bort 3/11/12 6:12 PM
We decided to remove it. It makes parsers really complicated, and it
is way simpler to deal with that with the Scala collection API
(usually using the groupBy operation)

So parse order ~ orderDetail, get a Seq[Order~OrderDetail] and then
deal with it in the Scala collection API like seq.groupBy(_._1)

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/h-w4thlpthMJ.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.

--
Guillaume Bort

Re: [play-framework] [2.0] spanM still part of Anorm? Ike 3/11/12 6:38 PM
OK, thanks. I'll try that approach.


On Sunday, March 11, 2012 9:12:11 PM UTC-4, Guillaume Bort wrote:
We decided to remove it. It makes parsers really complicated, and it
is way simpler to deal with that with the Scala collection API
(usually using the groupBy operation)

So parse order ~ orderDetail, get a Seq[Order~OrderDetail] and then
deal with it in the Scala collection API like seq.groupBy(_._1)

On Sun, Mar 11, 2012 at 6:25 PM, Ike <> wrote:
> Hi all,
>
> I can't find any references in the current documentation of in the sample
> apps for Anorm parsers that span multiple rows.For example, if I have an
> order/order-line-item relationship, and I do a join query that returns
> multiple rows per per order (one row for each order line item), what's the
> proper way to parse this with Anorm in 2.0?
>
> order ~ spanM(orderDetail)
>
> ??
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/h-w4thlpthMJ.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.

--
Guillaume Bort