[jboss-user] [EJB 3.0] - Re: Need some help with mapping
fhh
do-not-reply at jboss.com
Tue Apr 3 14:23:39 EDT 2007
anonymous wrote :
| Anyone have any thoughts on how to annotate a Store object to map the correct values?
|
Sorry, I really don't wnat to annoy you: Nobody will be able to help you because you have not described your problem.
The point of an object relational mapping is to map the relationship of java objects to the tables in a relational database. There a dozens of ways how to "map" the values to the tables the way you describe. And most of them will not be what you want.
There are basically three types in which two java objects might be related:
Class A may
* hold a reference to an object of class B
* hold a collection with references to objects of class B
* extend class B.
The first one is either 1:1 or n:1 (in SQL terminology) and is represented as either a foreign key relationship or by shared primary keys. The second is an 1:n or m:n relationship and is represented as a foreign key or via a join table. The last one uses either a union, shared keys or everthing is dumped into a single table.
So the question boils down to this: In which of the three relationships do Store and Type stand to each other?
Regards
Felix
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034243#4034243
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034243
More information about the jboss-user
mailing list