Closed GoogleCodeExporter closed 9 years ago
Original comment by clinton....@gmail.com
on 17 May 2010 at 1:38
Original comment by clinton....@gmail.com
on 17 May 2010 at 3:21
Original comment by clinton....@gmail.com
on 2 Jun 2010 at 4:45
can we bump this feature please. it's extremely helpful for people who have
immutable classes which only have constructor setters
Original comment by chengt
on 28 Mar 2011 at 9:44
sry I meant bump the priority
Original comment by chengt
on 28 Mar 2011 at 9:44
Any update on this
Original comment by Wig...@gmail.com
on 24 May 2011 at 3:14
I've attached a patch to inject an association or collection as a constructor
parameter. I've added tests to BindingTest to check that both the XML and
Annotation-based code works. The maven build was successful.
Please make any adjustments that you feel are necessary.
It would be appreciated if this could be included in the next release as the
code changes were relatively minor and shouldn't involve much risk.
Thanks.
Original comment by gus4...@gmail.com
on 12 Jun 2011 at 1:48
Attachments:
Hi, is there any update on this? The patch was uploaded 2 weeks ago and we were
hoping to see if the changes could be integrated. Thanks.
Original comment by gus4...@gmail.com
on 27 Jun 2011 at 6:27
It looks like a reasonable change. When I originally wrote MyBatis 3, I
didn't do anything that should threaten this feature, I just didn't have time
to test it (the implementation is relatively simple, but the edge cases and
broad impacts are hard to quantify and test). I can have a look at this one
for you.
Original comment by clinton....@gmail.com
on 27 Jun 2011 at 6:30
Sure, thanks for that. I'll write a couple more tests and upload them. Let me
know if there's any corner cases that you feel might be important.
Original comment by gus4...@gmail.com
on 27 Jun 2011 at 7:03
Hi Clint, just wondering if you've had a chance to take a look at the patch for
this fix? Thanks.
Original comment by gus4...@gmail.com
on 18 Jul 2011 at 11:17
Hey Gus.
I looked at your patch briefly and may have missed something but it seems that it potentially suffers from the n+1 as it only allows for an additional select. It's a good patch but I feel like it's only half the functionality. I don't know if you had plans or already done any work on including the rest of the functionality.
Original comment by chengt
on 21 Jul 2011 at 2:46
I updated your patch to build against trunk (3.0.6-SNAPSHOT) of mybatis and
added resultmap handling.
I added a small test for it that uses a mix of what you added with the select
and what I added with resultmap handling. It's kind of a naive test but it's
getting late over here.
Original comment by chengt
on 21 Jul 2011 at 8:18
Attachments:
Thanks for that! Apologies, I hadn't thought about that enough and had ignored
half of the question. Really appreciate that you've taken a look over it and
hope it might show up in a release soon.
Original comment by gus4...@gmail.com
on 21 Jul 2011 at 1:24
Fix provided by Gus and Tim. Committed as rev. 3833
Original comment by clinton....@gmail.com
on 22 Jul 2011 at 9:39
Original comment by eduardo.macarron
on 25 Jul 2011 at 8:26
Is it possible that I can use a nested resultmap instead of an Inner
select(<arg column="id" javaType="java.util.List"
select="selectPostsForBlog"/>)? I've read that inner selects perform far worse
than a join. But I have to test this, though. It would be great to use the same
syntax like usual resultmaps with the collection-tag between the arg-tag.
Any ideas?
Original comment by m...@philippadam.com
on 4 Aug 2011 at 11:33
I didn't try it with collections but the patch that was applied has both the
select feature that Gus submitted the patch for as well as the resultMap
feature.
So if your question was if this would allow us to do :
<arg column="id" javaType="java.util.List" resultMap="postsResultMap"/>
Then yes that will work now. I've been using an internal release of the 3.0.6
in my current projects using this feature to handle immutable datamodels that
don't expose a default constructor.
Original comment by chengt
on 4 Aug 2011 at 2:08
Thank you very much for your quick answer! That's actually what I searched for.
I don't get it to work but I use MyBatis for three days now. That might be the
reason. It would be great to see a full and simple example how to handle
collections in a constructor.
Original comment by m...@philippadam.com
on 5 Aug 2011 at 6:33
Original issue reported on code.google.com by
clinton....@gmail.com
on 17 May 2010 at 1:38