-->
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.  [ 3 posts ] 
Author Message
 Post subject: Is this Strange mapping possible?
PostPosted: Fri May 21, 2004 9:30 am 
Newbie

Joined: Wed Apr 07, 2004 1:32 pm
Posts: 18
Hello,

Is this strange mapping possible?

I have 2 classes.

Object and Relationship

I want object do have a Map, which the key would be Relationship, and the value would be a collection of other objects.

And if possible, the generated table beeing 3 pk, relationship's pk, source object's pk, and destination object's pk.

The use would be something like this:

Collection values = (Collection) obj.getRelationshipValues(relationship);

values have objects!

Thanks,
Felipe;


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 9:38 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Your schema seems strange:)
could you give more details about your DB schema


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:06 am 
Newbie

Joined: Wed Apr 07, 2004 1:32 pm
Posts: 18
Actually i'm not very worried about the database schema generated.

In one entity i want to have a map, with another entity as the key, and the value as a collection of the first entity.

Examples:

Relationship relationship = new Relationship();

Collection values = new HashSet();
values.add(new Object());
values.add(new Object());
values.add(new Object());

Object obj = new Object ();
obj.getRelationshipsValues().put(relationship, values);

What I'm doing is a generic database. My tables are:
Class, Object, Attribute, Relationship


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.