Hibernate version: 3 (Hibernate tools 3.1 beta 5)
I have a problem generating XML's from hbm2hbmxml in hibernate tools. Everything runs perfeclty and i have a mapping file like this:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jan 22, 2007 5:37:40 PM by Hibernate Tools 3.1.0.beta5 -->
<hibernate-mapping>
<class name="FlightRecord" table="flight_record">
<comment>
</comment>
<id name="idFlightRecord" type="int">
<column name="ID_FLIGHT_RECORD" />
<generator class="native" />
</id>
<many-to-one name="accountTypes" class="AccountTypes" fetch="select">
<column name="ACCOUNT_TYPE" length="45">
<comment>
</comment>
</column>
<column name="AIRLINECODE" length="3">
<comment>
</comment>
</column>
</many-to-one>
(...)
<many-to-one name="ticketTypes" class="TicketTypes" update="false" insert="false" fetch="select">
<column name="TICKET_TYPE" length="50">
<comment>
</comment>
</column>
<column name="AIRLINECODE" length="3">
<comment>
</comment>
</column>
</many-to-one>
<property name="lastName" type="string">
<column name="LAST_NAME" length="45">
<comment>
</comment>
</column>
</property>
<property name="firstName" type="string">
<column name="FIRST_NAME" length="45">
<comment>
</comment>
</column>
</property>
(...)
</class>
</hibernate-mapping>
The problem is as it won't let me persist the TICKET_TYPE column because I have to set update="false" and insert="false"due to the
Repeated column in mapping for entity. I have that issue in multiple tables since the foreign key often overlaps in the use of fields. What is the right approach for that? Any suggestions would be highly appreciated!
I'm really desperate trying to figure this one out. I know there are workarounds but shouldn't there be a more consistent way in implementing it by using .ftl - files or even easier?
Thanks...
Peter