tyhuohuo8
V2EX  ›  问与答

mybatis 使用<include ><property/></include>组合向<sql>标签动态传递值程序出错?

  •  
  •   tyhuohuo8 · Jan 13, 2020 · 1773 views
    This topic created in 2329 days ago, the information mentioned may be changed or developed.
    例子:
    <sql id="userColumns"> ${alias}.id,${alias}.username,${alias}.password </sql>
    <select id="selectUsers" resultType="map">
    select
    <include refid="userColumns"><property name="alias" value="t1"/></include>,
    <include refid="userColumns"><property name="alias" value="t2"/></include>
    from some_table t1
    cross join some_table t2
    </select>

    我代码中一使用<property>这个就一直循环报 Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.去除<property >,把<sql>里内容写死,就不会,这是什么原因?版本 mybatis-3.2.8;
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2653 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 10:26 · PVG 18:26 · LAX 03:26 · JFK 06:26
    ♥ Do have faith in what you're doing.