- This topic has 5 replies, 3 voices, and was last updated 16 years, 9 months ago by Riyad Kalla.
-
AuthorPosts
-
batkinsonMemberHello,
I am trying to use the JPA reverse engineering tool. I am using TopLink essentials, with an Oracle 10g XE database. When I try to generate the entities and DAOs, I keep getting the following error (taken from the log file)
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57) at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39) at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:409) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:119) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1929) at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:73) at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$7.execute(GenerateArtifactsJob.java:856) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89) at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:837) at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:401) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
What confuses me is that I’m not using hibernate; I’m using TopLink.
I am able to connect to the Oracle db in the Database explorer.
My persistence.xml file looks like this:
<persistence-unit name="SampleJPAOraclePU" transaction-type="RESOURCE_LOCAL"> <provider>oracle.toplink.essentials.PersistenceProvider</provider> <properties> <property name = "toplink.jdbc.driver" value = "oracle.jdbc.driver.OracleDriver"/> <property name = "toplink.jdbc.url" value = "jdbc:oracle:thin:SYMSERVER/Symserver@localhost:1521:XE"/> <property name = "toplink.jdbc.user" value = "symserver"/> <property name = "toplink.jdbc.password" value = "********"/> <property name = "toplink.platform.class.name" value = "oracle.toplink.essentials.platform.oracle.OraclePlatform" /> </properties> </persistence-unit>
I’m using
MyEclipse Enterprise Workbench Version: 6.0.1 GA
I have been able to successfully generate entities and DAOs using the MyEclipse Derby connection.
Thanks for the help,
Bryan
Loyal WaterMemberBryan,
Can you go to Project Properties, under MyEclipse, and see which icons are lit up… do you have JPA capabilities on that project?
batkinsonMemberHi Nipun,
Yes, the JPA icon is lit up. It is the only one.
Bryan
Riyad KallaMemberBryan,
I’m totally baffled by this one… So if you go to the DB explorere, and rev-eng our Derby database into the *same* project, it works fine… but if you do the exact same actions with your Oracle connection, it starts giving you Hibernate errors? (you are positive you are selecting JPA from the Rev Eng menu right?)
batkinsonMemberHi Riyad,
Thanks for your reply. I was actually doing the rev-eng from different projects, but I followed the same process. ie. create project, add jpa capabilities attaching to db driver, then reverse engineering a table. Closing all projects but one, then reverse engineering the oracle database into the project that the Derby database worked with solved the problem. I’m not sure exactly what happened, but I suspect I had some configuration problems on the second project. Your hint about the *same* project solved it.
Thanks very much.
Bryan
Riyad KallaMemberBryan,
I’m really glad it’s working now, cause I had no idea what to suggest next. Let’s chalk it up to code-goblins 😉 -
AuthorPosts