-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Help With Hibernate
PostPosted: Mon Mar 05, 2007 9:21 am 
Newbie

Joined: Mon Mar 05, 2007 8:56 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1

Hi Guys,

I am currently a beginner to Hibernate and am in the process of learning. I have MyEclipse which does do reverse engineering which is nice but I want to learn how this product works by coding it myself. I have created the hibernate.cfg.xml file in the root directory and created my persistent class with its mapping billing.hbm.xml in the same directory. The mapping file in mapped to the configuration file. Everytime I call:

SessionFactory sessionFactory = configuration.buildSessionFactory();

I get the following exception:

Exception in thread "main" 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:378)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:110)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
at com.hibernatedemo.test.HibernateReadTest.main(HibernateReadTest.java:26)

The dialect is set in my cfg file:

<hibernate-configuration>

<session-factory>
<property name="connection.username">root</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/skylite
</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="myeclipse.connection.profile">MySQL</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="max_fetch_depth">1</property>
<mapping resource="com/hibernatedemo/test/EchoMessage.hbm.xml" />
<mapping
resource="com/hibernatedemo/inheretencetest/Billing.hbm.xml" />

</session-factory>

</hibernate-configuration>

I do not understand what I am doing wrong?

Thanks and Regards

_________________
Adnan Arab


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 2:52 pm 
Senior
Senior

Joined: Tue Jul 25, 2006 9:05 am
Posts: 163
Location: Stuttgart/Karlsruhe, Germany
Hi,

Try changing it to the following:

Code:
<property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect</property>

Cheers,

Andy

_________________
Rules are only there to be broken


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 2:54 pm 
Senior
Senior

Joined: Tue Jul 25, 2006 9:05 am
Posts: 163
Location: Stuttgart/Karlsruhe, Germany
Hi,

Try changing it to the following:

Code:
<property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect</property>

Cheers,

Andy

_________________
Rules are only there to be broken


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 2:56 pm 
Senior
Senior

Joined: Tue Jul 25, 2006 9:05 am
Posts: 163
Location: Stuttgart/Karlsruhe, Germany
Hi,

Try changing it to the following:

Code:
<property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect</property>

Cheers,

Andy

_________________
Rules are only there to be broken


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 2:58 pm 
Senior
Senior

Joined: Tue Jul 25, 2006 9:05 am
Posts: 163
Location: Stuttgart/Karlsruhe, Germany
Sorry about the repeat postings but i am currently experiencing a few network issues

_________________
Rules are only there to be broken


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.