-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Modifying table names after class mapping with annotations?
PostPosted: Mon Nov 17, 2008 7:12 am 
Beginner
Beginner

Joined: Thu Oct 04, 2007 12:22 pm
Posts: 48
I need a way of modifying the table name of a mapped entity after or while it is mapped via annotations. Imaging a class with @Table(name="test"). It would be programmatically mapped via config.addAnnotatedClass(c);

Now is there the possibility to access the entity mapping, change the table name to say 'test_2' before the factory and therefore the tables are created?

some additional infos:
For tracking the modified table names correctly during the db operations I can easily write an own Interceptor. But the interceptor does only offer methods for adding code during database modifications. But I need a hook while creating the tables ..

Hibernate version:
3.3


Top
 Profile  
 
 Post subject: Solved
PostPosted: Mon Nov 17, 2008 11:37 am 
Beginner
Beginner

Joined: Thu Oct 04, 2007 12:22 pm
Posts: 48
Digging into the API I had some luck finding the solution: I wrote an own NamingStrategy object and feed it into the AnnotationConfiguration.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.