-->
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: Help mapping inheritance!!!!
PostPosted: Sun Jul 24, 2005 2:36 pm 
Beginner
Beginner

Joined: Thu Jul 14, 2005 10:11 am
Posts: 32
Hello!!!.

I'm using Hibernate 3.0.2, MS SQL Database.

I'm trying to map inheritance... but i'm having lots of problems with the GENERATOR tag. Well.. the following code doesn't work!!:

<class name="admin.Persona">

<id name="id" column="id" type="integer">
<generator class="native"/>
</id>

<property name="Activo" column="Activo" not-null="true" type="boolean"/>

<union-subclass name="admin.Administrador" table="Administradores">
</union-subclass>
</class>



It seems that i'm unable to put the ID in the abtract class ("Persona is abstract"). Any idea ???? i'm getting an exception... and i don't know how to solve this!!!

Thanks *** A LOT *** !!!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 2:42 pm 
Beginner
Beginner

Joined: Thu Jul 14, 2005 10:11 am
Posts: 32
i forgot something else...

Is it possible to map this??:

class A
class B extends A

class C extends B
class D extends A

Thanks :D


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 2:56 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
mcorleone wrote:
i forgot something else...

Is it possible to map this??:

class A
class B extends A

class C extends B
class D extends A

Thanks :D


http://www.hibernate.org/ForumMailingli ... AskForHelp

Please read the above link.... and then include your mapping files, your code, and the stack trace of the exception you are recieving - as indicated.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 3:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
If you would have posted the stack trace, everyone would have easily seen that it informs you that identity column key generation cannot be used with union-subclass (for extremely obvious reasons).

So, use a different strategy.


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.