I am developing a rich client application using Hibernate. I have the following plugins:
- Application: the module that connects all parts
- Model: contains the beans and their interfaces.
- Database: abstracts the database functions, contains the mapping file and all hibernate-specific code
- JDBC: contains and exports the jdbc jars
When I want to connect to the database from the Application, I instantiate a class in the Database plugin ant it does the Configuration and the Session management. The problem is that when I call Configuration.addURL with the mapping.hbm.xml file I get the following traceback:
07:37:41,650 INFO HbmBinder:438 - Mapping class: com.teamcenter.rbc.Cell -> Cells
07:37:41,821 ERROR Configuration:358 - Could not compile the mapping document
org.hibernate.MappingException: class com.teamcenter.rbc.Cell not found while looking for property: layout
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
at org.hibernate.mapping.ToOne.setTypeUsingReflection(ToOne.java:52)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:1500)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1479)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:579)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:1787)
at org.hibernate.cfg.Configuration.add(Configuration.java:355)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:392)
at org.hibernate.cfg.Configuration.addURL(Configuration.java:327)
It seems the hibernate classes cannot access the Model classes from the Model plug-in.
Any ideas on what should I do? I don't like bundling the Database and the Model plug-ins together since I want to be able to use the model without the dependency on Hibernate.
Thank you,
florin
|