Visual Paradigm Logo
     Build Quality Applications Faster, Better and Cheaper
 
Home | Products | Download | Documentation | Support | Resources | Partners | Quick Tour | Shop | Company |  
 
   Visual Paradigm Discussion Forum
  Login   [ Register ] Email: Password: Log me on automatically I lost my password  
Advanced Search
JOIN element in hbm for Generatlized Relationship  
Forum Index -> DB Visual ARCHITECT (DB-VA)
Author Message
Santm


Joined: 2008/02/18
Messages: 7

Offline

Do we get <JOIN > element in hbm-XML of base class for every generalized(inheritence) relationship in ORM ? or it comes only if the mapped tables are different (i.e. with referential integrety)?

If yes , then what would happen if both base class and derived class are mapped to same table?

ORM
ClassBase ---------------------- table1
----------------------
----------------------
----------------------
DerivedClass ----------------------- table1

hbm-xml

<hibernate-mapping>
<class name="ClassBase" table="tabel1" lazy="false" discriminator-value="table1">

.
.
.
..
<subclass name="Derivedclass" discriminator-value="xyz" lazy="false">
access="field"/>
<join table="table1">



 
Rain


Joined: 2005/04/29
Messages: 758

Offline

Hello Santm,

The <Join> element in hbm.xml is depends on how you specify the inheritance strategy in the class hierarchy. It only be generated if you are using table per sub-class strategy together with the discriminator column defined. Since using table per sub-class strategy already no need to have the discriminator column. May I know why you would like to generate the <Join>?

Best regards,
Rain Wong
 
Santm


Joined: 2008/02/18
Messages: 7

Offline

Infact we dont want JOIN because this JOIN tries to search for foreign key and in our design we have both base class and derived class mapped to same table. Yes our derived class inheritence strategy is 'table per class' Hierarchy and the derived class is 'table per subclass' hierarchy.

As per your documentation, we suppose that derived class should be table per class because we have only one table. However when we try generating code with base class as 'table per class' & also derived class as 'table per class' we are getting errors that asks to 'syncronise derived class with ERD'

please help.

 
 
   Forum Index -> DB Visual ARCHITECT (DB-VA)
Go to:   
Powered by JForum 2.1.4 © 2005 - Rafael Steil