-->
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.  [ 1 post ] 
Author Message
 Post subject: simulate <subclass> within <joined-subclass>
PostPosted: Thu Jun 17, 2004 12:28 pm 
Newbie

Joined: Thu Jun 17, 2004 12:16 pm
Posts: 1
my Problem is that I cannot place a subclass into a joined-subclass.
Any adea How I can solve my problem.
I've read about <any>, but cannot figure out if it can help, and how.

thanks

Code:
class A
{
   String id;
}

class AA extends A
{
}

class BA extends A
{
}

abstract class CA extends A
{
}

class ACA extends CA
{
}

class BCA extends CA
{
}


class A is in  table T_A
+-------------------------------
| TABLE T_A
| -------------------------------
| ID_A NUMBER(28) not null
+-------------------------------

calss AA is in table T_AA
+-------------------------------
| TABLE T_AA
| -------------------------------
| ID_AA NUMBER(28) not null
+-------------------------------

class BA is in table T_BA
+-------------------------------
| TABLE T_BA
| -------------------------------
| ID_BA NUMBER(28) not null
+-------------------------------

class CA, ACA, BCA are in table T_CA 
... where table  T_CA contains a column for discriminator TYPE_CA, so I can hava a ACA or a BCA
+-------------------------------
| TABLE T_CA
| -------------------------------
| ID_CA NUMBER(28) not null
| TYPE_CA varchar(5) notnull
+-------------------------------


I WANT ( skipped unnessary info )
-------

<class name="A" table="T_A">
  <ID name="id" column="ID_A" />
  ...
  <joined-subclass name="AA" table="T_AA">
    ...
  </joined-subclass

  <joined-subclass name="BA" table="T_BA">
    ...
  </joined-subclass

  <joined-subclass name="CA" table="T_CA">
     ...
     <discriminator column="TYPE_CA">
     <subclass name="ACA" discriminator-value="ACA" >
       ...
     </subclass>
     <subclass name="BCA" discriminator-value="BCA" >
       ...
     </subclass>
  </joined-subclass



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

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.