I defined a named query in my mapping file,
<sql-query name="getFlexibleAttributes">
<return alias="attribute" class="com.xxx.app.dal.AttributeTO"/>
<![CDATA[SELECT fd.LABEL as {attribute.attributeName}, fn.ATTRIBUTE_VALUE as
{attribute.attributeValue}
FROM TABLE_PART_NUM pn, TABLE_FA_PART_NUM fn, TABLE_FLEX_DEFN fd
WHERE fn.FA_PART_NUM2PART_NUM = pn.OBJID and
fd.ATTRIBUTE_NAME = fn.ATTRIBUTE_NAME and
pn.PART_NUMBER = :partNumber]]>
</sql-query>
What I'm trying to do is to pull data from three different tables into object AttributeTO. There is no physical table for the object AttributeTO. Is it doable? If the answer is yes, whatelse do I have to define in the mapping file?
Thanks.
|