reset password
Author Message
p0941
Posts: 95
Posted 10:29 Nov 03, 2009 |

Hi Dr. Sun, Maybe I miss something in the class about ORM, but when I tried to do mapping files for class inheritance, and inheriting class and inherited class are in different package as in our homework 3, I don't know which package I should indicate in the "<hibernate-mapping package="<some package>">".

Thanks

cysun
Posts: 2935
Posted 11:50 Nov 03, 2009 |

The package attribute tells Hibernate which package a class belongs to if the class is not fully qualified in the mapping file, i.e. it does not need to be the package of the super class or the subclass. In fact, you can do without the package attribute - simply use fully qualified names for all the classes in the mapping, e.g. use "csns.model.assignment.OnlineAssignment" instead of just "OnlineAssignment".