-->
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 non-isomorphic interface and class hierarchy
PostPosted: Wed Jun 15, 2005 12:53 pm 
Beginner
Beginner

Joined: Mon Nov 29, 2004 2:26 pm
Posts: 28
I wish to map an interface hierarchy which is implemented by a set of classes which do not have similar hierarchy. Example:

Mapped classes:
Code:
public interface IParent {
    int getP();
    void setP(int p);
}

public interface IChild extends IParent {
    int getC();
    void setC(int c);
}

public class ParentImpl extends Object {
    int p;
    public int getP() {
        return this.a;
    }
    public void setP(int p) {
        this.p = p;
    }
}

public class ChildImpl implements IChild extends SomeOtherObject {
    int p;
    int c;

    public int getP() {
        return this.a;
    }
    public void setP(int p) {
        this.p = p;
    }
    public int getC() {
        return this.c;
    }
    public void setC(int c) {
        this.c = c;
    }
}


The key point being that ChildImpl does not extend ParentImpl (as I need it to extend something else).

Is it possible to map these classes such that polymorphism loads / queries will still work?


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.