-->
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: casting classes that use discriminator value
PostPosted: Mon Jan 09, 2006 9:59 pm 
Newbie

Joined: Mon Aug 29, 2005 8:45 am
Posts: 3
Hi there,

I would like to know if can I update a class between classes that are using discriminator value.
So, I have a Administrator class, Analyst class and User class and I would like to do a cast from Administrator class for Analyst class for example. How can I to do it?

Is it possible?

Code:
<class name="User" table="users"  discriminator-value="0">

  <id name="id" type="string" column="id"/>

  <many-to-one
    name="level"
    column="level"
    class="Level"
    not-null="false"
    insert="false"
    update="false"
   />

   <discriminator column="level" type="integer"/>

   <subclass name="Analyst" discriminator-value="1"/>

   <subclass name="Administrator" discriminator-value="2">
     <property
   name="email"
   column="email"
   type="java.lang.String"
   not-null="true"
   length="50"
   />
   </subclass>
</class>


How Would I cast Administrator for Analyst?

Thx a lot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 8:15 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
I am sorry, but you cannot do this. You may read a book about Java inheritance.

Regards Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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.