I can't understand this problem; I'm all at sea.

classic Classic list List threaded Threaded
2 messages Options
K
Reply | Threaded
Open this post in threaded view
|

I can't understand this problem; I'm all at sea.

K
hi ~
xxxMapper.java have a method :
List<A> selectA();

xxxMapper.xml
<select id="selectA" resultType="B">

Can you call this method without an error?
I hope to get your professional answers. Thank you very much.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: I can't understand this problem; I'm all at sea.

Ray Sprinkle
List<A> is a generic which is only type checked at compile time due to type erasure.  The adding of B to the list at runtime will not be caught 


On Fri, Apr 26, 2019, 12:06 AM K <[hidden email]> wrote:
hi ~
xxxMapper.java have a method :
List<A> selectA();

xxxMapper.xml
<select id="selectA" resultType="B">

Can you call this method without an error?
I hope to get your professional answers. Thank you very much.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.