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.  [ 9 posts ] 
Author Message
 Post subject: beginner !!!
PostPosted: Thu Oct 19, 2006 9:50 am 
Newbie

Joined: Thu Oct 19, 2006 9:37 am
Posts: 12
Hi everybody,

I'm just starting using Hibernate Tools 3.2.7 with Eclipse 3.2.
I created a poor database on postgresql with 2 tables Book and Author, with a foreign key in Book on Author.
I created first a configuration file.
After I use the code generation option and enabled the reverse engineer option. It worked fine and generated me java file on this 2 tables and 2 XML mapping files.
When I switch Hibernate Console Perspective, I can see my configuration with a new sessionfactory but I can't run any HQL request because it says the table I select is not mapped. Moreover, it's said online I should see "mapped entities" and it's not here !
I don't understand.
Could you help me ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 10:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
does your hibernate.cfg.xml contain the generated mapping files ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 11:26 am 
Newbie

Joined: Thu Oct 19, 2006 9:37 am
Posts: 12
You're right !
Now it's ok, I can see my class description under SessionFactory.
But ifI try this poor request "select name from Author"
it doesn't work !
Is there something special to do after the mapping is done ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 11:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what does "doesn't work" mean ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 3:14 am 
Newbie

Joined: Thu Oct 19, 2006 9:37 am
Posts: 12
this is the message I received :
"org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block"


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 3:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try and enable autocommit and see if that works better for you.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 8:33 am 
Newbie

Joined: Thu Oct 19, 2006 9:37 am
Posts: 12
it doesn't work !!!
I have a table named Author in the public schema in Postgresql.
I just run "select name from Author" and it says "relation public.author does not exist"
I don't understand !


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 9:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and the schema is named "public" ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 10:13 am 
Newbie

Joined: Thu Oct 19, 2006 9:37 am
Posts: 12
Now it's OK !!!
I found the mistake.
I created my tables quickly via pgadmin and I write them with a first uppercase and it does not like it at all !
Now, no problem.
Thanks a lot for your patience Max.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.