mybatis insert data result the primary key

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

mybatis insert data result the primary key

clockwork_zhi
mybatis version : 3.3.1
java version : 1.8
java entity : 
   Base<T>{
  private T id;
}

Po extends Base<Long>{
}

mysql: id bigint(20)

<insert id="add" parameterType="Po" useGeneratedKeys="true" keyProperty="id">

result Po entity id's type bigint.and not change to long ;

why?

--
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: mybatis insert data result the primary key

Guy Rouillier-2
On 3/7/2019 4:27:28 AM, [hidden email] wrote:

mybatis version : 3.3.1
java version : 1.8
java entity : 
   Base<T>{
  private T id;
}

Po extends Base<Long>{
}

mysql: id bigint(20)

<insert id="add" parameterType="Po" useGeneratedKeys="true" keyProperty="id">

result Po entity id's type bigint.and not change to long ;

why?

Perhaps this answers your question: 
https://stackoverflow.com/questions/46998896/mysql-bigint-conversion-to-java-long

--
Guy Rouillier

--
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.