周记 2016.5.31

Posted 酒醉三分醒

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了周记 2016.5.31相关的知识,希望对你有一定的参考价值。

1. 插入对象后获取主键

    <insert id="add" useGeneratedKeys="true" keyProperty="vo.id">

     如果传的是(@Param("vo") Employee vo) 形式的参数,需要使用vo.id。如果直接使用(Employee vo),则使用keyProperty="id"

     注意:执行完操作后,vo对象中将有主键值,不是返回主键值。

2. 配置多个maven profiles环境时,配置可以在eclipse 中的tomcat启动项目:

    You can activate the maven profile at the Eclipse by using the following step: -

    1).Right click at your project and select properties .

    2).At the Properties windows select Maven.

    3).At the right hand panel you will see Active Maven Profiles text box.

    4).Please enter your profile name, e.g. development or production.

     参考:http://stackoverflow.com/questions/16280858/maven-profiles-and-tomcat-in-eclipse

3. 使用maven profile实现多环境可移植构建

    http://blog.csdn.net/mhmyqn/article/details/24501281

 

 

 

 


    

 

以上是关于周记 2016.5.31的主要内容,如果未能解决你的问题,请参考以下文章

插入后如何立即获取唯一主键ID的值[重复]

Mybatis 怎么返回insert插入的主键

使用红移插入行后获取主键

mybatis中useGeneratedKeys用法--插入数据库后获取主键值

mybatis框架---mybatis插入数据后获取自增主键

在 asp.net 中插入后获取主键(visual basic)