These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: The generated elt column
PostPosted: Mon Jan 16, 2006 8:35 pm 
Newbie

Joined: Tue Dec 27, 2005 3:30 am
Posts: 11
There are a number of posts about where the generated column named elt comes from. Haven't seen an answer. I'm getting it in a many-to-many bidirectional association using Map collections.

Here is the Hibernate mapping:

<class entity-name="TestAssembly" table="TEST_ASSEMBLY"
name="com.sitepen.jsonpersistence.test.TestAssembly">
<id name="Id" column="testAssemblyId">
<generator class="native"/>
</id>
<dynamic-component name="Members">
<property name="assemblyName" type="string"/>
<map name="parts" table="TEST_ASSEMBLY_PARTS" cascade="all">
<key column="testAssemblyId"/>
<map-key column="testPartId" type="long"/>
<many-to-many class="TestPart"/>
</map>
</dynamic-component>
</class>
<class entity-name="TestPart" table="TEST_PART"
name="com.sitepen.jsonpersistence.test.TestPart">
<id name="Id" column="testPartId">
<generator class="native"/>
</id>
<dynamic-component name="Members">
<property name="partName" type="string"/>
<map name="assemblys" table="TEST_ASSEMBLY_PARTS" cascade="all"
inverse="true">
<key column="testPartId"/>
<map-key column="testAssemblyId" type="long"/>
<many-to-many class="TestAssembly"/>
</map>
</dynamic-component>
</class>


Here is the code generated with schemaexport:

create table TEST_ASSEMBLY (
testAssemblyId bigint generated by default as identity (start with 1),
assemblyName varchar(255),
primary key (testAssemblyId)
);

create table TEST_ASSEMBLY_PARTS (
testAssemblyId bigint not null,
elt bigint not null,
testPartId bigint not null,
primary key (testAssemblyId, testPartId)
);

create table TEST_PART (
testPartId bigint generated by default as identity (start with 1),
partName varchar(255),
primary key (testPartId)
);

alter table TEST_ASSEMBLY_PARTS
add constraint FKDDE06A741E1F1165
foreign key (elt)
references TEST_ASSEMBLY;

alter table TEST_ASSEMBLY_PARTS
add constraint FKDDE06A74BF7F7072
foreign key (elt)
references TEST_PART;

alter table TEST_ASSEMBLY_PARTS
add constraint FKDDE06A74EFE3284B
foreign key (testAssemblyId)
references TEST_ASSEMBLY;

alter table TEST_ASSEMBLY_PARTS
add constraint FKDDE06A7456EA3725
foreign key (testPartId)
references TEST_PART;


Where did the "elt" come from? What is the purpose? Can I get rid of it?

TIA


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.