Hibernate version:
2
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="com.socManager.scm.model.data.dbms">
<class name="Artifacttype" table="artifacttype" dynamic-insert="false">
<id
column="artifacttype_id"
name="Id"
type="java.lang.Long"
>
<generator class="vm" />
</id>
<property
column="artifacttype_name"
length="100"
name="ArtifacttypeName"
not-null="true"
type="string"
/>
<property
column="artifacttype_description"
name="ArtifacttypeDescription"
not-null="false"
type="string"
/>
<joined-subclass name="Projectartifacttype"
table="projectartifacttype">
<key column="artifacttype_id" />
<property
column="project_alias"
length="40"
name="ProjectAlias"
not-null="true"
type="string"
/>
</joined-subclass>
</class>
</hibernate-mapping>
Name and version of the database you are using:
Postgre 7.3
Hi!
I'm facing a problem when I try to save the joined subclass Projectartifacttype.
The Projectartifacttype VO extends the Artifacttype VO. To save the Projectartifacttype, I have to set the Artifacttype properties (id, name and description) with values of an existent Artifacttype row.
After that, I call the save method to the Projectartifacttype VO. this method inserts a new row in the Projectartifacttype table and in the Artifacttype table.
The problem is that I only want to insert a new row on the Projectartifacttype table and not on the Artifacttype.
What do I have to do to avoid the automatic insert on the Artifacttype table?
Thanks for the help!
Cunha
|