-->
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: Entity mapping, need help
PostPosted: Mon Aug 04, 2008 6:40 am 
Newbie

Joined: Sat Aug 02, 2008 6:41 am
Posts: 3
Hello. I have some problem with entity mapping and I would be thankful if somebody help me.

There is an IMAGE table in database. Fields: id, name, path, source_id and source_type.

SOURCE_TYPE - can be property(image belongs to property), user(image belongs to user) and so on

source_id is something like foreign key(actually it isn't)...
For example if source_type is user,then source_id references to USER table.
If source_type is property, source_id references to PROPERTY table.

I have to map this Entity. So that for example PROPERTY entity had a Set<Image>, and USER entity had a Set<Image> and so on..

Those relations must be unidirectional..


@Entity
class Property {

//What annotations I should put here?
Set<Image> set..........
}

With Best regards, Maksim.


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.