|
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
|