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: Mapping and subclassing with couple tables
PostPosted: Wed May 11, 2005 8:20 am 
Newbie

Joined: Wed May 11, 2005 8:05 am
Posts: 1
Hibernate version:3.03

DB Schema

PossibleBuildParam --- CpProfileParam -- Profile
|
|
CpRequestParam -- Request ----------------

*There is also an association between Request and Profile, only forum shows it incorrect when I put it in, due to the spaces


The PossibleBuildparam has an paramId, name, value, allowInRequest etc
The CpProfileParam has paramId, profile, value, allowInRequest
The CpRequestParam has paramId, request, value

In the database the parameters are mostly couple tables, with overruling/additional values. I need a way to subclass possibleparam, with e.g. profile param, but let that subclass ave its own primary key [Profile, paramId]

I have read the documentation, but don't see the light.


Mapping documents:

Code:
<class
    name="***PossibleBuildParam"
    table="PossibleBuildParams"
>

    <id
        name="paramId"
        type="java.lang.Integer"
        column="paramId"
        unsaved-value="0"
    >
        <generator class="identity" />
    </id>

    <!-- A versioned entity. -->
   <version name="objectVersion"
          column="objectVersion"
          access="org.hibernate.property.DirectPropertyAccessor"
          unsaved-value="negative"
   />
<property
        name="paramName"
        type="java.lang.String"
        column="paramName"
        not-null="true"
        unique="true"
        length="25"
    />
<property
        name="paramType"
        type="java.lang.String"
        column="paramType"
        length="10"
    />
<property
        name="allowInRequest"
        type="boolean"
        column="allowInRequest"
        length="1"
    />

<!-- bi-directional one-to-many association to CpBuildProfileParam -->
    <set
        name="cpBuildProfileParams"
        lazy="true"
        inverse="true"
      cascade="none"
    >
        <key>
            <column name="paramId" />
        </key>
        <one-to-many
            class="***.model.CpBuildProfileParam"
        />
    </set>


Using MSSQL


Help apprieciated
Thanx in advance
[/code]


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.