Zolf
asked on
Java Hibernate question
Hello there,
Can somebody explain to me this relationship mapping between entities.
for e.g.
I have a Driver class and a Vehicle class
now when I have the <many-to-one> element in the driver.hbm.xml file
this driver is the many or the vehicle is the many.
cheers
zolf
Can somebody explain to me this relationship mapping between entities.
for e.g.
I have a Driver class and a Vehicle class
now when I have the <many-to-one> element in the driver.hbm.xml file
this driver is the many or the vehicle is the many.
cheers
zolf
A real-life modelling would be M2M. One person often drives different vehicles. From the POV of the vehicle, it would often have more than one driver.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Cardinality is often clarified by thinking of the use cases of your data model. Let's take a real life example of modelling for a car pool with the following two common use cases:
a. Find all vehicles that Mr. Anthony Brown has driven from the car pool
b. Find all drivers of vehicle with licence plate FOOZ12
That would be done via M2M
a. Find all vehicles that Mr. Anthony Brown has driven from the car pool
b. Find all drivers of vehicle with licence plate FOOZ12
That would be done via M2M
ASKER
thanks everybody for the feedbacks!!
by: sharonseth
this is exactly what I am looking for. can you please tell me or refer me to some good online tutorial on hibernate with xml configuration. I have read many articles but no where it explained like to mentioned.
can you please giv em more e.g to clear my doubt.
so if I have a hbm file Manager and Project
and I have a Many-to-One in the Project hbm file
then I will read it as Many Project are assigned to One Manager
by: sharonseth
this is exactly what I am looking for. can you please tell me or refer me to some good online tutorial on hibernate with xml configuration. I have read many articles but no where it explained like to mentioned.
can you please giv em more e.g to clear my doubt.
so if I have a hbm file Manager and Project
and I have a Many-to-One in the Project hbm file
then I will read it as Many Project are assigned to One Manager
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks vey much