Hello.
We generating our source java files with <hbm2java/> from a set of source hbm files.
I want to use component feature of the mapping file and have a problems with the folloing mapping file:
Code:
<hibernate-mapping package="ru.invito.model">
<class name="BookingOrder" table="booking_order">
<meta attribute="implements" inherit="false">ru.invito.model.BusinessObject</meta>
<id name="code" column="CODE" type="java.lang.Long">
<meta attribute="use-in-equals">true</meta>
<generator class="sequence">
<param name="sequence">booking_order_seq</param>
</generator>
</id>
.. some properties and many-to-one relations..
<component name="transferService" class="ru.invito.model.support.FlaggedBookingServices">
<property name="flagValue" column="TRANSFER_FLAG" />
<property name="price" column="TRANSFER_PRICE" />
<property name="providerId" column="TRANSFER_FLAG_PROVIDER_ID" />
</component>
</class>
</hibernate-mapping
When the compiled class ru.invito.model.support.FlaggedBookingServices not present on the classpath i receive a:
Code:
java.lang.ClassNotFoundException: ru.invito.model.support.FlaggedBookingServices
But, when a compile it before running <hbm2java/> task, the tool successfully finishes it's work (with warning: Component ru.invito.model.support.FlaggedBookingServices found more than once! Will only generate the last found.)
AND my source java file FlaggedBookingServices is overwritten with hbm2java exporter.
Is this a feature? How to instruct the tool not to (re)generate a component file, but use existing as a reference in generated entity?