ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerome Jacobsen" <jerome.jacob...@gentootech.com>
Subject RE: Changing result set metadata on the fly.
Date Fri, 10 Dec 2004 13:52:45 GMT
I submitted a RFE to Sourceforge Tracker back in September that
would allow for something similar to what you want.  The RFE
ID is 1034260 (Named dynamic for reuse).

I checked a couple of weeks ago to see if it made it into Jira
but it didn't.  I asked the maillist on Nov 30 why it didn't
make it but got no response.

Anyway, with this RFE your statements would look something
like this:

<dynamic id="myBigDynamic">
 FROM
 (
   SELECT
       rownum as rownumber,
       e.emp_employee_id as employeeId,
       e.emp_name as employeeName,
       e.emp_manager as managerId,
       e.manager_name as managerName,
       e.muid as managementUnitId,
       e.name as managementUnitName,
       cS.course_Id as courseId,
       cS.course_title as courseTitle,
       cS.start_datetime as courseDate,

                 cS.module_status_id
   FROM
       (select 
           e.emp_employee_id,
           e.emp_name,
           em.emp_employee_id as emp_manager,
           em.emp_name as manager_name,
           mu.muid,
           mu.name
   ..... (lots more)
</dynamic>

<statement id="getEmployeeAndLastCourseCount">
           parameterClass="EmployeeAndLastCourseParam"
           resultClass="java.lang.Long">
 Select count(*) as count
 <dynamic refId="myBigDynamic"/>
</statement>

<statement id="getEmployeeAndLastCourse" 
           parameterClass="EmployeeAndLastCourseParam"
           resultClass="TrainingRequestListModel">
 Select 
   rownumber,
   employeeId,
   employeeName,
   managerId,
   managerName,
   managementUnitId,
   managementUnitName,
   courseId,
   courseTitle,
   courseDate
 <dynamic refId="myBigDynamic"/>
</statement>

So it is 2 small statements and one large reusable dynamic.

-Jerome


Mime
View raw message