Hello.
I have a mapping like the following:
<hibernate-mapping>
<class name="es.tid.psstlatam.api.wgw.WGWContent" table="WGWContent">
<id name="id" type="long" unsaved-value="null">
<!--<column name="id" unique-key="PK_WGWContent"/>-->
<generator class="sequence">
<param name="sequence">WGWContent_sequence</param>
</generator>
</id>
<discriminator column="discriminator" type="string"/>
<property name="name" />
<property name="description" />
<property name="day" />
<property name="published" />
<property name="priority" />
<!-- Relations to other tables -->
<many-to-one name="site" column="WGWSite_id" class="es.tid.psstlatam.api.wgw.WGWSite"
not-null="true" foreign-key="FK_WGWContent_WGWSite"/>
<!-- Subclasses in other files -->
</class>
</hibernate-mapping>
and the generated DDL is like the following:
create table WGWContent (
id NUMBER(19,0) not null,
discriminator VARCHAR2(255) not null,
name VARCHAR2(255),
description VARCHAR2(255),
day DATE,
published NUMBER(1,0),
priority NUMBER(10,0),
WGWSite_id NUMBER(19,0) not null,
filename VARCHAR2(255),
title VARCHAR2(255),
summary VARCHAR2(255),
text VARCHAR2(255),
url VARCHAR2(255),
primary key (id)
);
I would like to assign a custom name for the primary key. How can I do this? It is possible or foreign keys using the "foreign-key" attribute of a many-to-one mapping.
Thank you, M.
|