From a behavior perspective, why do you believe that isn't the correct use of the annotation? The javadoc says, "name of the targeted table". In your use case, it does not appear you're specifying an explicit name of the table and so Hibernate uses the name of the entity as the table name. To me, "name of the targeted table" in this case is in-fact the name of the entity class as you described. You didn't include an error stack trace, so a bit of the following is based of my of test. I created a simple test case that uses appliesTo with an invalid table name and I get the following error stack with the unnecessary parts removed for breavity:
org.hibernate.testing.junit4.CallbackException: org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase#buildEntityManagerFactory
....
Caused by: org.hibernate.AnnotationException: @org.hibernate.annotations.Table references an unknown table: datas_de
at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:1133)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:772)
The error message seems clear to me given that the name of the table was "Datas_De" and not "datas_de" . |