After being inspired to try and implement this, I gave it a shot with
the help of my good buddy Larry. However, after actually writing the
code, he went "oops, the order the maps are loaded is significant!".

In any case, the modifed class and test cases added are attached.





On 5/10/06, Larry Meadors <[EMAIL PROTECTED]> wrote:
That would be great - i know there is one on the WIKI already, but
take a look and update it if you need to.

Larry


On 5/10/06, Christopher Lamey <[EMAIL PROTECTED]> wrote:
> Hello,
>
> It turns out the groupBy attribute references a property in the
> resultMap, not a column.
>
> Doh!
>
> It'd be nice if the iBATIS DataMapper PDF mentioned that on page 29 and
> used different names in the example on page 28 (rather than 'quarter'
> for everything).
>
> I'd be willing to put together a FAQ item with an working example of
> groupBy hitting two tables via a join if anyone thinks that's useful.
>
> Cheers,
> topher
>
>

Attachment: SqlMapWildCardTest.java
Description: Binary data

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMapConfig      
    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"      
    "http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>

<sqlMapConfig>

  <properties resource="com/ibatis/sqlmap/maps/SqlMapConfig.properties"/>

  <!-- settings
	add these to test bug 976614
	enhancementEnabled="false"
    lazyLoadingEnabled="false"
  -->

  <settings
    cacheModelsEnabled="true"
    enhancementEnabled="false"
    lazyLoadingEnabled="true"
    maxRequests="32"
    maxSessions="10"
    maxTransactions="5"
    useStatementNamespaces="false"
    />

  <typeAlias alias="order" type="testdomain.Order"/>
  <typeAlias alias="OuiNonBool" type="com.ibatis.sqlmap.extensions.PirateTypeHandlerCallback"/>

  <typeHandler javaType="boolean" jdbcType="VARCHAR" callback="OuiNonBool"/>

  <transactionManager type="JDBC" commitRequired="false">
    <dataSource type="${dataSourceType}">
      <property name="JDBC.Driver" value="${driver}"/>
      <property name="JDBC.ConnectionURL" value="${url}"/>
      <property name="JDBC.Username" value="${username}"/>
      <property name="JDBC.Password" value="${password}"/>
      <property name="JDBC.DefaultAutoCommit" value="true"/>
      <property name="Pool.MaximumActiveConnections" value="10"/>
      <property name="Pool.MaximumIdleConnections" value="5"/>
      <property name="Pool.MaximumCheckoutTime" value="120000"/>
      <property name="Pool.TimeToWait" value="500"/>
      <property name="Pool.PingQuery" value="select 1 from ACCOUNT"/>
      <property name="Pool.PingEnabled" value="false"/>
      <property name="Pool.PingConnectionsOlderThan" value="1"/>
      <property name="Pool.PingConnectionsNotUsedFor" value="1"/>
      <property name="Pool.QuietMode" value="true"/>
    </dataSource>
  </transactionManager>

  <!--<sqlMap resource="${SqlMapPath}/Account.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/DynamicAccount.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/Order.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/LineItem.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/OracleProc.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/Complex.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/XmlStatements.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/DomStatements.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/RepeatingGroupMapping.xml"/>-->
  <!--<sqlMap resource="${SqlMapPath}/Documents.xml"/>-->
  <sqlMap resource="${SqlMapPath}/*.xml"/>

</sqlMapConfig>

Attachment: SqlMapConfigParser.java
Description: Binary data

Attachment: Resources.java
Description: Binary data

  • Re: two ?s Jerome Gagner

Reply via email to