Zolf
asked on
Eclipse Hibernate plugin
Hello there,
I am using eclipse IDE with hibernate plugin to write Hibernate JPA application. The problem I have is when I right click the project to provide me with the mapping diagram.i get error.But I have another project which uses hibernate with the mapping in the cfg.xml and for it it displays the mapping diagram. I am wondering if it works with JPA.please help.
cheers
Zolf
16-05-2011-09-42-29.gif
THis one also looks similar
http://seamframework.org/Documentation/WhyCantJBossToolsFindThePersistenceUnitOfASeamgenProject
ASKER
my apologies,can you please guide me,i dont seem to understand what to do
ASKER
do i add this in my configuration file as mentioned here http://docs.jboss.org/tools/3.0.0.GA/en/hibernatetools/html/ant.html
<hibernatetool>
<jdbcconfiguration propertyfile="etc/hibernat
<hbm2hbmxml destdir="${build.dir}/src"
</hibernatetool>
ASKER
in hibernate perspective in Eclipse,i have these jars too
16-05-2011-10-22-29.gif
16-05-2011-10-22-29.gif
have you specified type jpa in your console configuration?
ASKER
it should be set to jpa
and set your connection to the jpa configured one (i assume you configuring the connection with jpa)
ASKER
if i change to JPA,it then gives me this warning
[Classpath]: Persistence unit not found: 'null'.
what do i need to do.please guide me
ASKER
see my comment above regards configuring connection
ASKER
>>and set your connection to the jpa configured one
you mean this. i have the jars in my classpath,i have the image attached above
no, the database connection in the console configuration
ASKER
yes
looks like you also need to use a JPA Project
looks like you also need to use a JPA Project
ASKER
so,i need to delete this project and again start new with JPA project??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
cheers
ASKER
is it included in your persistence.xml?
ASKER
i was running my JPA application without this persistence.xml. the book i am refering to does not mention anything about this xml file. i mention my class files like this
public static Configuration getInitializedConfiguratio
{
Configuration config = new Configuration();
/* add all of your JPA annotated classes here!!! */
config.addAnnotatedClass(C
config.addAnnotatedClass(C
config.addAnnotatedClass(A
config.addAnnotatedClass(S
config.configure();
return config;
}
ASKER
i also have my hibernate.cfg.xml file in my root path
ASKER
got it.thanks!!
This seems to be a discussion of related problem
(Persistence unit not found):
Perhoas you could find somethig useful here:
https://forum.hibernate.org/viewtopic.php?f=6&t=1002123