I used RevEng to generate java and hbm from a sample database. The java class matches one to one to the hbm files except for two id generator classes.
My HibernateFactory class has a cfg.addDirectory(modelDirectory) which points to the directory containing both the hbm and .class files. This always worked up to now, but in this case gets a
org.hibernate.MappingException: component class not found: model.OrderdetailsId
I don't know why hibernate can not find the id class (it definitely is there), when it found all the other non-id classes.
I then tried add all the .class one by one, instead of adding the directory. now I get
org.hibernate.MappingNotFoundException: resource: model/OrderdetailsId.hbm.xml
which is true, since there is no hbm for the id class.
what is really the problem? I figure it is not a classpath problem, because, hibernate does seem to find all the classes except the id classes. it seems to insist that for every java class, there must be a corresponding hbm file.
search the web came up with reports by other people of the same problem, but never answered. anyone has any insights?
|