The following doesn't seem to work for connect by oracle native sql it does original query as if it were generating query. I tried without table="CONTACT_US_TOPIC_HEADER" and got same result. What do I need to do differently?
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.bcbsma.contactus.business.domain">
<class
name="ContactUsTopicHeader"
table="CONTACT_US_TOPIC_HEADER"
>
<id
name="id"
type="integer"
column="TOPIC_HEADER_ID"
>
<generator class="sequence">
<param name="sequence">CONTACT_US_TOPIC_HEADER_ID_SEQ</param>
</generator>
</id>
<property
name="topicHeader"
column="TOPIC_HEADER"
type="string"
not-null="true"
length="255"
/>
<property
name="sortOrder"
column="SORT_ORDER"
type="integer"
not-null="true"
length="22"
/>
<property
name="level"
column="LEVEL"
type="integer"
not-null="true"
length="22"
/>
<many-to-one
name="parentTopicHeader"
column="PARENT_TOPIC_HEADER_ID"
class="ContactUsTopicHeader"
not-null="false"
>
</many-to-one>
<many-to-one
name="topic"
column="TOPIC_ID"
class="ContactUsTopic"
not-null="true"
>
</many-to-one>
<set name="infoLines"
inverse="true"
lazy="true"
cascade="all"
order-by="SORT_ORDER"
>
<key column="TOPIC_HEADER_ID"/>
<one-to-many class="ContactUsTopicInfo"/>
</set>
<loader query-ref="contactUsTopicHeader"/>
</class>
<sql-query name="contactUsTopicHeader">
<return alias="h" class="ContactUsTopicHeader"/>
select {h.*} from contact_us_topic_header h
start with parent_topic_header_id is null
connect by prior topic_header_id=parent_topic_header_id
</sql-query>
</hibernate-mapping>