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.  [ 4 posts ] 
Author Message
 Post subject: I though it was fixed!
PostPosted: Fri Dec 09, 2005 4:32 am 
Beginner
Beginner

Joined: Mon May 02, 2005 6:17 pm
Posts: 41
Hello,
i'm having problems enabling multiple column unique constraints on a superclass an it's subclass. I've read in this forum that it' fixed but it didn't work for me. I downloaded 3.rc3 an still nothing. Here is my mapping file

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>
<!--
        Auto-generated mapping file from
        the hibernate.org cfg2hbm engine
-->
    <class name="AttributeDataType" table="ATTRIBUTEDATATYPE">
        <id name="attributeDataTypeId">
            <column name="ATTRIBUTEDATATYPEID" />
            <generator class="sequence">
            <param name="sequence">attributeDataTypeId_sq</param>
         </generator>
        </id>
      <discriminator column="attributeDataTypeTypeId" />
      <version name="beanVersion"
         column="version_"
         type="long"
      />

      <property name="dataTypeId" >
            <column name="DATATYPEID" not-null="true"/>
        </property>
      <property name="attributeDataTypeTypeId" insert="false" update="false">
            <column name="attributeDataTypeTypeId" />
        </property>
        <property name="name" unique-key="unique">
            <column name="NAME"  not-null="true" />
        </property>
        <property name="description" >
            <column name="DESCRIPTION"  />
        </property>
        <property name="maxLength">
            <column name="MAXLENGTH" />
        </property>
        <property name="minLength">
            <column name="MINLENGTH" />
        </property>
        <property name="isMandatory" type="true_false">
            <column name="ISMANDATORY" not-null="true" />
        </property>
        <property name="defaultValue" >
            <column name="DEFAULTVALUE" />
        </property>
        <property name="regex" >
            <column name="REGEX" />
        </property>
      
      <subclass name="ServiceObjectAttributeType" discriminator-value="1">
         <join table="ServiceObjectAttributeType">
            <key column="serviceObjectAttributeTypeId" />
            <property name="statusId" column="statusId" />
            <property name="deliverableTypeId" column="deliverableTypeId" />
            <property name="serviceObjectTypeId" column="serviceObjectTypeId" unique-key="unique"/>
            
         </join>
      </subclass>
      
      
             
    </class>
</hibernate-mapping>


Am I doing something wrong or is it a bug? I'm trying to make a pair name and serviceObjectTypeId unique but it's not happening.

_________________
www.globalresearch.ca


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 4:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Ah. yes.

It is a bug in Hibernate that no database on earth lets you have a unique key constraint that spans multiple tables....


wtf?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 7:53 am 
Beginner
Beginner

Joined: Mon May 02, 2005 6:17 pm
Posts: 41
Then what's this all about?
http://forum.hibernate.org/viewtopic.ph ... nheritance

_________________
www.globalresearch.ca


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 8:02 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This is about something completely different. Read again what Gavin wrote.


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