-->
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.  [ 2 posts ] 
Author Message
 Post subject: Does the XDOCLET TAG @hibernate.joined-subclass work
PostPosted: Thu Aug 25, 2005 9:43 am 
Newbie

Joined: Mon Jan 10, 2005 9:16 am
Posts: 18
Hello,

I'm new in using XDOCLET and Hibernate for doing a TOP-DOWN development Process. But the Tag @hibernate.joined-subclass doesn't work. So get the following Error. Is this my fault? What can I do better to solve this Problem.

Thanks a lot.

Hibernate version: 3.03

Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="de.tmobile.ebf.blizzard.assembly.hbm.BaseAssemblyImpl"
>

<id
name="id"
column="ID"
type="long"
unsaved-value="null"
>
<generator class="sequence">

</generator>
</id>

<set
name="componentsShar"
lazy="false"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="componentsShar_id"
>
</key>

<one-to-many
class="de.tmobile.ebf.blizzard.assembly.hbm.CompositePartImpl"
/>

</set>

<set
name="componentsPriv"
lazy="false"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="componentsPriv_id"
>
</key>

<one-to-many
class="de.tmobile.ebf.blizzard.assembly.hbm.CompositePartImpl"
/>

</set>

<one-to-one
name="superAssembly"
class="de.tmobile.ebf.blizzard.assembly.hbm.ComplexAssemblyImpl"
cascade="all"
outer-join="auto"
constrained="false"
/>

<one-to-one
name="module"
class="de.tmobile.ebf.blizzard.assembly.hbm.ModuleImpl"
cascade="all"
outer-join="auto"
constrained="false"
/>

</class>

</hibernate-mapping>

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="de.tmobile.ebf.blizzard.assembly.hbm.AssemblyImpl"
table="ASSEMBLY"
>

<id
name="id"
column="ID"
type="long"
unsaved-value="null"
>
<generator class="sequence">

</generator>
</id>

<one-to-one
name="superAssembly"
class="de.tmobile.ebf.blizzard.assembly.hbm.ComplexAssemblyImpl"
cascade="all"
outer-join="auto"
constrained="false"
/>

<one-to-one
name="module"
class="de.tmobile.ebf.blizzard.assembly.hbm.ModuleImpl"
cascade="all"
outer-join="auto"
constrained="false"
/>

<joined-subclass
name="de.tmobile.ebf.blizzard.assembly.hbm.BaseAssemblyImpl"
table="BASEASSEMBLY"
>
<key
/>

<set
name="componentsShar"
lazy="false"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="componentsShar_id"
>
</key>

<one-to-many
class="de.tmobile.ebf.blizzard.assembly.hbm.CompositePartImpl"
/>

</set>

<set
name="componentsPriv"
lazy="false"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="componentsPriv_id"
>
</key>

<one-to-many
class="de.tmobile.ebf.blizzard.assembly.hbm.CompositePartImpl"
/>

</set>

</joined-subclass>

</class>

</hibernate-mapping>



Full stack trace of any exception that occurs:

Java POJO with XDOCLET TAGS
The Class AssemblyImpl

/**
*
* @author lba
*
* @hibernate.class
* table=ASSEMBLY
*
*/
public class AssemblyImpl implements java.io.Serializable, Assembly
{

private ComplexAssemblyImpl superAssembly = null;

private ModuleImpl module = null;

public AssemblyImpl()
{
}

public void setSuperAssembly(ComplexAssemblyImpl x) {
this.superAssembly = x;
}

/**
* @hibernate.one-to-one
* class="de.tmobile.ebf.blizzard.assembly.hbm.ComplexAssemblyImpl"
* cascade="all"
*/
public ComplexAssemblyImpl getSuperAssembly() {
return superAssembly;
}

public void setModule(ModuleImpl x) {
this.module = x;
}

/**
* @hibernate.one-to-one
* class="de.tmobile.ebf.blizzard.assembly.hbm.ModuleImpl"
* cascade="all"
*/
public ModuleImpl getModule() {
return module;
}

}

The Class BaseAssemblyImpl

import java.util.*;

/**
*
* @author lba
*
* @hibernate.joined-subclass
* table=BASEASSEMBLY
*
*/
public class BaseAssemblyImpl extends AssemblyImpl implements BaseAssembly {

private Set componentsPriv;
private Set componentsShar;

public BaseAssemblyImpl() {
componentsPriv = new HashSet();
componentsShar = new HashSet();
}


public void addComponentsPriv( CompositePartImpl x ) {
componentsPriv.add( x );
}

public void addComponentsShar( CompositePartImpl x ) {
componentsShar.add( x );
}

/**
* @hibernate.set
* cascade="all"
* inverse="true"
* @hibernate.collection-key
* column="componentsShar_id"
* @hibernate.collection-one-to-many
* class="de.tmobile.ebf.blizzard.assembly.hbm.CompositePartImpl"
*/
public Set getComponentsShar() {
return componentsShar;
}

/**
* @hibernate.set
* cascade="all"
* inverse="true"
* @hibernate.collection-key
* column="componentsPriv_id"
* @hibernate.collection-one-to-many
* class="de.tmobile.ebf.blizzard.assembly.hbm.CompositePartImpl"
*/
public Set getComponentsPriv() {
return componentsPriv;
}

public void setComponentsPriv(Set componentsPriv) {
this.componentsPriv = componentsPriv;
}

public void setComponentsShar(Set componentsShar) {
this.componentsShar = componentsShar;
}
}

Stack Trace

[schemaexport] 611 [2005-08-25 15:29:42,553] INFO org.hibernate.cfg.Configuration - Mapping file: D:\Eclipse Projekte\OO7_benchmark\src\metadata\hibernate\generated\de\tmobile\ebf\blizzard\assembly\hbm\BaseAssemblyImpl.hbm.xml
[schemaexport] 651 [2005-08-25 15:29:42,593] ERROR org.hibernate.cfg.Configuration - Could not compile the mapping document
[schemaexport] org.hibernate.MappingException: duplicate import: de.tmobile.ebf.blizzard.assembly.hbm.BaseAssemblyImpl
[schemaexport] at org.hibernate.cfg.Mappings.addImport(Mappings.java:101)
[schemaexport] at org.hibernate.cfg.HbmBinder.bindPersistentClassCommonValues(HbmBinder.java:540)
[schemaexport] at org.hibernate.cfg.HbmBinder.bindClass(HbmBinder.java:487)
[schemaexport] at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:233)
[schemaexport] at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
[schemaexport] at org.hibernate.cfg.Configuration.add(Configuration.java:360)
[schemaexport] at org.hibernate.cfg.Configuration.addFile(Configuration.java:226)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:195)
[schemaexport] at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:135)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)
[schemaexport] at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:265)
[schemaexport] at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:195)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:383)
[schemaexport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:136)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 10:24 am 
Newbie

Joined: Mon Jan 10, 2005 9:16 am
Posts: 18
Sorry, it works. I had a Mapping file overwrite Problem.


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

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.