Thank you Mr. Butler! 
I'm already using abator to speed up our development process, and
actually for the time being, 
after I write custom queries I just create a small script to execute in
our db that will generate the resultmaps, if it can be any help, here's
the query i used in oracle:
 
SQL> CREATE OR REPLACE VIEW v_temp AS SELECT b.dname, b.loc, a.* FROM
emp a, dept b WHERE a.deptno = b.deptno;
 
View created.
 
SQL> SELECT    '<result property="' || UPPER (column_name) || '"
column="' || UPPER (column_name) || '" javaType="'
  2         || DECODE (data_type,
  3                    'NUMBER', DECODE (data_scale, 0, 'int',
'double'),
  4                    'VARCHAR2', 'string',
  5                    'VARCHAR', 'string',
  6                    'DATE', 'date',
  7                    'CHAR', 'string',
  8                    'LONG', 'string')
  9         || '" jdbcType="' || data_type || '" '
 10         || CASE
 11               WHEN UPPER (data_type) IN
 12                                        ('CHAR', 'VARCHAR2', 'LONG',
'VARCHAR')
 13                  THEN 'nullValue=""'
 14            END
 15         || '/>' resultmap
 16    FROM all_tab_columns
 17   WHERE LOWER (owner || '.' || table_name) = 'v_temp' OR LOWER
(table_name) = 'v_temp';
 
RESULTMAP
------------------------------------------------------------------------
----------------------------
<result property="LOC" column="LOC" javaType="string"
jdbcType="VARCHAR2" nullValue=""/>
<result property="EMPNO" column="EMPNO" javaType="int" jdbcType="NUMBER"
/>
<result property="ENAME" column="ENAME" javaType="string"
jdbcType="VARCHAR2" nullValue=""/>
<result property="JOB" column="JOB" javaType="string"
jdbcType="VARCHAR2" nullValue=""/>
<result property="MGR" column="MGR" javaType="int" jdbcType="NUMBER" />
<result property="HIREDATE" column="HIREDATE" javaType="date"
jdbcType="DATE" />
<result property="SAL" column="SAL" javaType="double" jdbcType="NUMBER"
/>
<result property="COMM" column="COMM" javaType="double"
jdbcType="NUMBER" />
<result property="DEPTNO" column="DEPTNO" javaType="int"
jdbcType="NUMBER" />
<result property="DNAME" column="DNAME" javaType="string"
jdbcType="VARCHAR2" nullValue=""/>
 
10 rows selected.
 
SQL> DROP VIEW v_temp;
 
View dropped.
 
SQL>

Yusuf.

-----Original Message-----
From: Jeff Butler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 20, 2005 8:40 PM
To: user-java@ibatis.apache.org
Subject: Re: [ABATOR] Future Plans


Thanks for your suggestion!  Abator does not support this now.
 
However, I have been thinking about this feature too.  I'd like to add
some way to declare table relationships and have Abator generate the
appropriate queries and objects.  It would be a little different from
what you've specified...I would use the iBATIS "group by" and imbedded
object support.  It is a complex problem because of the many different
types of relationships (1-1, 1-*, *-*, etc.), but it would be
interesting to solve it. 
 
For now, the best thing to do is extend the Abator generated objects and
result maps, and then write custom queries.
 
Jeff Butler


Reply via email to