-->
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.  [ 4 posts ] 
Author Message
 Post subject: Retro-engineer from hibernate config files
PostPosted: Wed Oct 01, 2008 9:42 pm 
Newbie

Joined: Wed Oct 01, 2008 9:34 pm
Posts: 2
Hello,

I have a J2EE project which use Hibernate. I have the hibernate config files (.hbm) but the project was developped with several databases (5 databases : several Oracle et several Progress) and I don't have the databases or the create script. I'm not expert with config file.

So does anybody know if there is a tool that can generate database script (create) from hibernate config files?

Thanks a lot.

Best regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2008 1:27 am 
Beginner
Beginner

Joined: Mon Apr 02, 2007 8:08 am
Posts: 24
Look at the documentation. You'll find you can configure Hibernate to generate the database at application boot time:

<property name="hibernate.hbm2ddl.auto" value="create-drop"/></properties>

_________________
--
<a href="http://ideasse.blogspot.com/">Ideas + Software Engineering</a> (English)
<a href="http://iiso.blogspot.com/">Ideas + IngenierĂ­a del Software</a> (Spanish)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 03, 2008 9:39 am 
Newbie

Joined: Wed Oct 01, 2008 9:34 pm
Posts: 2
Hello,

I've tried but it doesn't work. I have the following message with one database (Oracle before but I want to change the database to SQL Server).

Does anybody have any idea?

13:30:59,056 ERROR HibernateUtil:53 - Initial SessionFactory creation failed.
org.hibernate.MappingException: could not instantiate id generator
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:98)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:192)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.infodb.util.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:43)
at com.infodb.ric.servlet.InitHbServlet.init(InitHbServlet.java:75)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.hibernate.MappingException: Dialect does not support sequences
at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:595)
at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:65)
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:94)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 03, 2008 10:58 am 
Beginner
Beginner

Joined: Mon Apr 02, 2007 8:08 am
Posts: 24
Error seems quite clear: "Caused by: org.hibernate.MappingException: Dialect does not support sequences"

Have you set up the dialect at the config file? It doesn't seem to, since you say you're using Oracle, which supports sequences. Maybe you've let the default one.

_________________
--
<a href="http://ideasse.blogspot.com/">Ideas + Software Engineering</a> (English)
<a href="http://iiso.blogspot.com/">Ideas + IngenierĂ­a del Software</a> (Spanish)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.