0

I have a problem with a entity class. When I run my app with hibernate.hbm2ddl.auto = create, then it create all the other entity tables but not this on. Why is that? And when I create the table by myself and after that try to insert something into it, then I get this error: http://pastebin.com/m4gjxqNC

Here's my entity class: User entity: http://pastebin.com/YXvzFSgt Comment entity: http://pastebin.com/RpZEUPxN

And here's the UserDAO class http://pastebin.com/LrTCg0GC

1
  • What DBMS are you using and what JDBC driver? The BBM2DLL might be generating incorrect SQL syntax if you are not using the correct driver for your DB. Also, is Hibernate aware of your User entity? Make sure it is being included in the mapped classes or annotated classes/packages. Commented Jun 3, 2011 at 14:15

1 Answer 1

1

You seems to be using PostgreSQL. As per this document, 'User' is a PostgreSQL reserved word. Try adding a @Table("user_tb") annotation for your User entity, to force a new table name.

@Entity
@Table("user_tb")
public class User extends LightEntity implements Serializable {
 //..

}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.