tyhuohuo8
V2EX  ›  问与答

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

  •  
  •   tyhuohuo8 · Jan 13, 2020 · 1820 views
    This topic created in 2355 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   ·   901 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:12 · PVG 05:12 · LAX 14:12 · JFK 17:12
    ♥ Do have faith in what you're doing.