-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem with mapping union-subclass
PostPosted: Thu Nov 22, 2007 4:18 am 
Beginner
Beginner

Joined: Tue May 11, 2004 8:24 am
Posts: 23
Hi,

can anyone help me to find the problem in the following mapping.

There are no problems on runtime, but schema-export fails.
On latest hibernate version 3.2.

Many thanks in advance.

Alex

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="de.webjazz.pleasure.backend.model.customer.impl" default-lazy="false">

    <class name="ProcedureItemImpl" abstract="true" optimistic-lock="version">
        <id name="ID" type="long">
            <generator class="seqhilo">
                <param name="sequence">position_id_sequence</param>
            </generator>
        </id>

        <version name="version" type="long"/>
        <property name="created" type="timestamp" not-null="true"/>
        <property name="changed" type="timestamp" not-null="true"/>
        <property name="creator" length="120" not-null="true"/>
        <property name="changer" length="120" not-null="true"/>

        <many-to-one name="procedure" column="procedure_id" class="ProcedureModelImpl" fetch="select" not-null="true" />
        <property name="orderBy" type="integer" not-null="true"/>

        <union-subclass name="PositionNoteModelImpl" table="position_note">
            <property name="name" length="200"/>
            <property name="description" type="string" length="32672"/>
        </union-subclass>

        <union-subclass name="PositionModelImpl" table="position">

            <many-to-one name="mwst" column="mwst_id"
                         class="de.webjazz.pleasure.backend.model.global.impl.MwstModelImpl" fetch="select"
                         not-null="true" outer-join="false"/>
            <property name="currency" type="currency" not-null="true" index="position_currency_index"/>
            <property name="homeCurrency" type="currency" not-null="true" index="position_homecurrency_index"/>
            <property name="netto" type="boolean" not-null="true"/>

            <property name="name" length="200" index="position_name_index"/>
            <property name="description" type="string" length="32672"/>
            <property name="info" type="string" length="32672"/>
            <property name="note" type="string" length="32672"/>
            <property name="productGroupCode" length="50"/>
            <property name="stockNo" length="50" index="position_stockno_index"/>
            <property name="customerReference" length="120"/>
            <property name="showGroup" type="boolean" not-null="true"/>
            <property name="price" type="double" not-null="true"/>
            <property name="homePrice" type="double" not-null="true"/>
            <property name="quantity" type="double" not-null="true"/>
            <property name="procedureDiscountable" type="boolean" not-null="true"/>
            <property name="countable" type="boolean" not-null="true"/>
            <property name="deliverable" type="boolean" not-null="true"/>
            <property name="account" type="integer"/>
            <property name="projectInfo" length="250"/>
            <property name="statsGroup" length="150" index="position_stats_group_index"/>
            <property name="statsSubGroup" length="150" index="position_stats_sub_group_index"/>
            <property name="forceStatsGroup" type="boolean" not-null="true"/>
            <property name="deliverDate" type="timestamp"/>
            <property name="total" type="double" not-null="true"/>
            <property name="homeTotal" type="double" not-null="true"/>
            <property name="nettoTotal" type="double" not-null="true"/>
            <property name="homeNettoTotal" type="double" not-null="true"/>

            <set name="addons" inverse="true" cascade="delete" batch-size="50">
                <key column="position_id"/>
                <one-to-many class="PositionAddonModelImpl"/>
            </set>
        </union-subclass>

    </class>

</hibernate-mapping>



Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 5:32 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
Fails? With which kind of error/exception?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 6:42 am 
Beginner
Beginner

Joined: Tue May 11, 2004 8:24 am
Posts: 23
Ant shows the following exception:

Code:
/Users/al/Development/It's a Pleasure/Application/ant/build.xml:37: Schema text failed: Could not parse mapping document from file /Users/al/Development/It's a Pleasure/Application/src/hibernate/customer/Position.hbm.xml

...

Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from file /Users/al/Development/It's a Pleasure/Application/src/hibernate/customer/Position.hbm.xml


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.