Table not created by Hibernate
Posted
by
User1
on Stack Overflow
See other posts from Stack Overflow
or by User1
Published on 2009-09-03T23:44:25Z
Indexed on
2011/11/29
17:50 UTC
Read the original article
Hit count: 240
I annotated a bunch of POJO's so JPA can use them to create tables in Hibernate. It appears that all of the tables are created except one very central table called "Revision". The Revision class has an @Entity(name="RevisionT")
annotation so it will be renamed to RevisionT so there is not a conflict with any reserved words in MySQL (the target database).
I delete the entire database, recreate it and basically open and close a JPA session. All the tables seem to get recreated without a problem.
Why would a single table be missing from the created schema? What instrumentation can be used to see what Hibernate is producing and which errors?
Thanks.
UPDATE: I tried to create as a Derby DB and it was successful. However, one of the fields has a a name of "index". I use @org.hibernate.annotations.IndexColumn
to specify the name to something other than a reserved word. However, the column is always called "index" when it is created.
Here's a sample of the suspect annotations.
@ManyToOne
@JoinColumn(name="MasterTopID")
@IndexColumn(name="Cx3tHApe")
protected MasterTop masterTop;
Instead of creating MasterTop.Cx3tHApe
as a field, it creates MasterTop.Index
. Why is the name ignored?
© Stack Overflow or respective owner