ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott.Smi...@L-3com.com
Subject Returning child class as base class
Date Wed, 19 Aug 2009 19:08:07 GMT
I am wondering if there is a way to use iBatis to perform a query that
will return multiple child classes as the base class.  Here is a
simplified example of the situation:


*         Working in Java 1.6 with iBatis 2.3 and postgreSQL 8.3

*         I have a base class Product with child classes PhysicalProduct
and ElectronicProduct.

*         I have result maps for both child classes, and various queries
to return lists of each type.  For simplicity, just consider two select
statements: selectAllElectronic (returns List<ElectronicProduct>) and
selectAllPhysical (returns List<PhysicalProduct>)

*         I want to define a query (selectAllProducts) that will return
a combined list of both Physical and Electronic products as a
List<Product>.  I can clearly do this in java code by invoking each
query in succession and combining the results.  Is there a way to do the
equivalent within the sql map?


View raw message