Hi,
I have a problem with the SchemaExport tool. It is not generating a sequence for the primary key. Can this be done with the tool or do I need to create the sequences in the database manually?
Thanks in advance for the help,
Snebla
Hibernate version: 3.05
Name and version of the database you are using: Oracle 9i
Mapping documents:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class table="TEDCT_TSAC_TS_ACTIVATION" name="au.com.suncorp.easydoc.web.domain.hibernate.Activation">
<id unsaved-value="null" name="id" type="java.lang.Integer" column="TSAC_ID" length="32">
<generator class="sequence">
<param name="sequence">TEDCT_TS_TEMPLATE_SET_SEQUENCE</param>
</generator>
</id>
<many-to-one foreign-key="FK_TSAC_TSAC_TS_ID_01" class="au.com.suncorp.easydoc.web.domain.hibernate.TemplateSet" name="templateSet">
<column name="TSAC_TS_ID" not-null="true"/>
</many-to-one>
<property name="activationDate">
<column name="ACTIVATION_DTM" index="IXU_TSAC_01" not-null="true"/>
</property>
<many-to-one foreign-key="FK_TSAC_TSAC_APP_ID_02" class="au.com.suncorp.easydoc.web.domain.hibernate.Application" name="application">
<column name="TSAC_APP_ID" index="IXU_TSAC_01" not-null="true"/>
</many-to-one>
</class>
</hibernate-mapping>
Generated Schema:Code:
create table TEDCT_TSAC_TS_ACTIVATION (
TSAC_ID number(10,0) not null,
TSAC_TS_ID number(10,0),
ACTIVATION_DTM timestamp not null,
TSAC_APP_ID number(10,0) not null,
primary key (TSAC_ID)
)
create index IXU_TSAC_01 on TEDCT_TSAC_TS_ACTIVATION (ACTIVATION_DTM, TSAC_APP_ID)
alter table TEDCT_TSAC_TS_ACTIVATION add constraint FK_TSAC_TSAC_TS_ID_01 foreign key (TSAC_TS_ID) references TEDCT_TS_TEMPLATE_SET
alter table TEDCT_TSAC_TS_ACTIVATION add constraint FK_TSAC_TSAC_APP_ID_02 foreign key (TSAC_APP_ID) references TEDCR_APP_APPLICATION