Did you ever open this API up as mentioned:
Quote:
Actually, Hibernate Annotations core has the ability to change the annotations at runtime (even if I did not opened this API), I think creating the ORM.xml is probably easier, but if you're interested in contributing a bit, we can talk about opening this API.
I am currently have the same data in 2 datastores, the only difference being that one of them only presents views. The tables are t_<tablename> with views v_<tablename> so I need to be able to switch do something along the lines of:
Code:
...
AnnotationConfiguration tableConfig = new AnnotationConfiguration();
tableConfig.addAnnotatedClass( MyClass1.class );
tableConfig.addAnnotatedClass( MyClass2.class );
tableConfig.addAnnotatedClass( MyClass3.class );
tableSessionFactory = tableConfig.configure( "hibernate_table.cfg.xml" ).buildSessionFactory();
AnnotationConfiguration viewConfig = new AnnotationConfiguration();
viewConfig.addAnnotatedClass( MyClass1.class );
viewConfig.addAnnotatedClass( MyClass2.class );
viewConfig.addAnnotatedClass( MyClass3.class );
<do something to change the table name from t_my_class_1 to v_my_class_1>
<do something to change the table name from t_my_class_2 to v_my_class_2>
<do something to change the table name from t_my_class_3 to v_my_class_3>
viewSessionFactory = viewConfig.configure( "hibernate_view.cfg.xml" ).buildSessionFactory();
...