I am using hibernate tools version 3.1.0.alpha5 to generate the artifacts of a database view defined as following:
create view TDV_ProductOrderItem as
select
TD_OrderItem.UNITPRICE as Price,
TD_ORDERS.ORDERTYPE as Type,
TD_ORDERS.PURCHASEORDERNUMBER as OrderNumber,
TD_PRODUCT.DESCRIPTION as Description,
TD_PRODUCT.SKUID as SKU,
TD_OrderItem.ORG_ID as orgId
from
TD_OrderItem,
TD_ORDERS,
TD_PRODUCT
where
TD_OrderItem.ORDER_TBL_ID=TD_ORDERS.ORDER_TBL_ID AND
TD_OrderItem.PRODUCT_TBL_ID=TD_PRODUCT.PRODUCT_TBL_ID
WITH CHECK OPTION;
Where the TD_xxx are the tables defined in the same schema.
The problem is that the mapping file (hbm.xml is generated as the following:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class name="com.tdemand.generated.pojo.TdvProductorderitem" table="TDV_PRODUCTORDERITEM" schema="APPS">
<composite-id name="id" class="com.tdemand.generated.pojo.TdvProductorderitemId">
<key-property name="price" type="double">
<column name="PRICE" precision="126" scale="0" />
</key-property>
<key-property name="type" type="big_decimal">
<column name="TYPE" precision="22" scale="0" />
</key-property>
<key-property name="ordernumber" type="string">
<column name="ORDERNUMBER" length="20" />
</key-property>
<key-property name="description" type="string">
<column name="DESCRIPTION" />
</key-property>
<key-property name="sku" type="big_decimal">
<column name="SKU" precision="22" scale="0" />
</key-property>
<key-property name="orgId" type="long">
<column name="ORG_ID" precision="18" scale="0" />
</key-property>
</composite-id>
</class>
</hibernate-mapping>
The problem here is that it groups all the fields in the view as a composit ID. My question here is : How to eleminate the composit Id effect? I just want it be generated as a plain mapping without any composit id.
BTW I un-checked the "generate compisit id" box when I was generating the artifacts.
Thanks for your help
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:[/b]
[b]Mapping documents:[/b]
[b]Code between sessionFactory.openSession() and session.close():[/b]
[b]Full stack trace of any exception that occurs:[/b]
[b]Name and version of the database you are using:[/b]
[b]The generated SQL (show_sql=true):[/b]
[b]Debug level Hibernate log excerpt:[/b]