-->
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.  [ 14 posts ] 
Author Message
 Post subject: Datastore
PostPosted: Mon Jun 14, 2004 3:27 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
Hi. I've just started using Hibernate and found this problem.
I use the next code:

Datastore ds = Hibernate.createDatastore();
ds.storeClass(IbtRegistros.class);
SessionFactory sf = ds.buildSessionFactory();
Session session = sf.openSession();
IbtRegistros nuevo=new IbtRegistros();

It tells me this:

- Datasotre cannot be resolved or is not a type
- The method createDatastore is not defined for the type Hibernate

How can I solve this?
Thanks in advance
Regards from Spain


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 4:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
The code is no longer relevant for any recent Hibernate version, go read some tutorial about Hibernate2


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 5:09 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
I can't find anything similar... could you please help me?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 5:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
http://www.hibernate.org/78.html#A3


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 5:39 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 6:00 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
Is this better??

Configuration cfg=new Configuration();
cfg.addClass(IbtRegistros.class);
SessionFactory sf = cfg.buildSessionFactory();
Session session = sf.openSession();

The problem is that it doesn't work


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 6:29 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
It returns this error:

java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/Configuration

But I checked Configuration.class is in hibernate2.jar, and I imported it correctly


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Some hibernate.jar hibernate2.jar mismatch ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 6:04 pm 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
I don't know...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 6:14 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Did you check your CP to find some Hib.jar Hib2.jar mismatch ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 15, 2004 7:45 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
Just hibernate2.jar...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 16, 2004 5:31 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
which other jar files from the package do I have to put in the classpath?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 16, 2004 7:16 am 
Newbie

Joined: Mon Jun 14, 2004 3:24 am
Posts: 12
I finally solved it.
The problem was that I was adding hibernate2.jar to the eclipse's classpath, but not to the web-inf/lib directory
Now I get this exception:

java.lang.UnsupportedOperationException: The user must supply a JDBC connection

I tried making a JDBC Connection before using Hibernate, but it didn't solve anything.

Can you help me?

Regards
Miguel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 21, 2004 3:14 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check the Tut in the reference guide, it'll show you how to use and put your configuration file.

_________________
Emmanuel


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