Hi, folks
I am learning Hibernate and I am following the book 'hibernate quickly'. When I run the the example from the website site(
http://www.manning.com/peak/, following the source code link) for chapter 5, after running the ant to create the tables, I found that in the 'join' or 'link' tables between the 2 tables, m_events & m_attendees, and the 'link' table, event_attendees, which should have only 2 PKs from the 2 tables, has an unexpected column, named 'elt'?
The mapping files are the follows:
//======= EventManyToMany.hbm.xml =======//
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.manning.hq.ch05.manytomany.EventManyToMany" table="m_events">
<id name="id" column="uid" type="long" unsaved-value="null">
<generator class="native"/>
</id>
<property name="name" type="string" length="100"/>
<property name="startDate" column="start_date"
type="date"/>
<property name="duration" type="integer"/>
<many-to-one name="location" column="location_id"
class="com.manning.hq.ch05.manytomany.LocationManyToMany"/>
<set name="speakers" table="event_speakers" cascade="all">
<key column="event_id"/>
<many-to-many class="com.manning.hq.ch05.manytomany.SpeakerManyToMany"/>
</set>
<set name="attendees" table="event_attendees" cascade="all">
<key column="event_id"/>
<many-to-many class="com.manning.hq.ch05.manytomany.AttendeeManyToMany"/>
</set>
</class>
</hibernate-mapping>
//=== AttendeeManyToMany.hbm.xml =====//
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.manning.hq.ch05.manytomany.AttendeeManyToMany" table="m_attendees">
<id name="id" column="uid" type="long">
<generator class="native"/>
</id>
<property name="firstName" type="string" length="20"/>
<property name="lastName" type="string" length="20"/>
<set name="events" table="event_attendees" cascade="all">
<key column="attendee_id"/>
<many-to-many class="com.manning.hq.ch05.manytomany.EventManyToMany"/>
</set>
</class>
</hibernate-mapping>
The resultant 'event_attendees' table will have structure like this:
event_id
elt attendee_id
The '
elt' field is the one that is confusing me.
Could anyone give me some hints why hibernate created such field?
Btw, I have hibernate 3.0.
Thanks in advance!
X.Chen