Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Accessing Hiber...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3719 of 3747
Post > Topic >>

Accessing Hibernate mappings in an external jar

by Marco <zakmck@[EMAIL PROTECTED] > Apr 22, 2008 at 07:44 AM

Hi all,

I have a JAR which stores the classes for an object model. It also
defines the JPA annotations needed for doing Hibernate persistence.
The package also uses persistence.xml and <persistence-unit>, with no
need to list the mapped classes, cause they are automatically read
from the code.

So far so good, but now I need to use the resulting JAR from another
application. I need to do basic things, such as creating an object and
saving it in the DB. I cannot make Hibernate working in this case. It
tells me the class X is not mapped. I can have it working only if I
explicitly specify all the mapped classes in persistence.xml (via
<class>). Is there a way to tell hibernate to go through the jars in
the CLASSPATH?

Thanks in advance.

Cheers.

Marco.




 1 Posts in Topic:
Accessing Hibernate mappings in an external jar
Marco <zakmck@[EMAIL P  2008-04-22 07:44:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 22:34:21 CDT 2008.