-->
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: please help, cannot create table...
PostPosted: Mon Apr 25, 2005 1:54 am 
Regular
Regular

Joined: Fri Feb 25, 2005 3:02 am
Posts: 71
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version: 3.0[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using: postgresql 8.0 [/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]

Hi,

Am actually trying to create tables in my db from xdoclet tag placed in each of my class.
For my class User, I've put the following

@hibernate.class
table = "user"

but, table user has not been created. I then made the following modification:

@hibernate.class
table = "my_user"

Now it has been created. It seems that the word 'user' is reserved for Hibernate!! Is this true?
Can anyone please explain why this is so. Or have I made a mistake.

thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2005 6:44 am 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
"User" is a reserved word in most database implementations. Did you try running the DDL manually and see if you got any errors? Hibernate doesn't (AFAIK) have any keyword restrictions, nor should it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2005 7:37 am 
Regular
Regular

Joined: Fri Feb 25, 2005 3:02 am
Posts: 71
Hi,

Since I'm new to Hibernate can you please explain to me what do you mean by runnning 'DDL manually'. In fact what is DDL?

thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2005 7:40 am 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
DDL is Data Definition Language, the subset of SQL that is used to define tables and such: Google

You are using Postgres, with which I'm not familiar - but I assume there is some way to manually execute SQL commands. I don't know how you're generating the Hibernate schema, but somewhere you probably have a command starting e.g.
Code:
create table user ...


I'd highly suggest picking up a good book on database concepts, you'll have a very hard time understanding Hibernate if you don't understand databases.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 25, 2005 7:52 am 
Regular
Regular

Joined: Fri Feb 25, 2005 3:02 am
Posts: 71
thank you very much for your explanation


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.