Ok, here is a quick example to show you that "auto aliasing" also works
with HSQLDB:


1. Download Ibatis JPetStore Example from 
 
http://ftp.hosting-studio.de/pub/linux/apache/ibatis/binaries/ibatis.jav
a/JPetStore-5.0.zip

2. Expand it and take the /build/wars/jpetstore.war and put it under
your tomcat webapps directory

3. Start tomcat and load the JPetStore startpage to check if everything
is OK

4. Stop tomcat and edit Category.xml in the expanded jpetstore context
directory. 
   The file can be found in the
\WEB-INF\classes\com\ibatis\jpetstore\persistence\sqlmapdao\
subdirectory.
  
   Change the resultmap FROM:

  <resultMap id="categoryResult" class="category">
    <result property="categoryId" column="CATID"/>
    <result property="name" column="NAME"/>
    <result property="description" column="DESCN"/>
  </resultMap>

   TO: 

  <resultMap id="categoryResult" class="category">
    <result property="categoryId" column="category.CATID"/>
    <result property="name" column="category.NAME"/>
    <result property="description" column="category.DESCN"/>
  </resultMap>


5. Restart Tomcat and navigate to the Jpetstore index page. 


You should see that everything still works fine and the categories
"Fish", "Dogs", etc. are still shown correctly. The difference is, that
now you have "auto aliasing" when using the category resultmap in joins.

Hope this helps a little to understand my feature wish,
B. Behler



Reply via email to