Hi folks,
I'm using Hibernate as persistence provider within JBoss Application Server 6. Within my project, I've created a class User.java which I've annotated to be an entity. Strangely, when I deploy my project, the mapped table is only created in my database when I add the @table annotation and specified a name which must be different from the entity class simple name.
Here's my entity class :
@Entity @Table(name="Users") public class User { ... }
To summarize :
- No @Table annotation --> no table created in my database - @Table annotation with no table name specified --> no table created in my database (due to the fact that when no name specified, its default value is the entity class simple name, I guess) - @Table annotation with name="User" --> no table created in my database - @Table annotation with name != "User" --> OK
Does someone know why?
Thanks in advance.
|