-->
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: org.hibernate.cfg.DefaultComponentSafeNamingStrategy
PostPosted: Wed Jun 30, 2010 4:28 am 
Newbie

Joined: Wed Jun 30, 2010 4:20 am
Posts: 3
I'm having some trouble getting hibernate to prefix database table columns with the name of the embedded object they represent. I'm using @Embeddable on the contained object, and @Embedded on the attribute in the parent object. I've tried programmatically setting the naming strategy using:
Code:
configuration.setProperty("hibernate.ejb.naming_strategy",
"org.hibernate.cfg.DefaultComponentSafeNamingStrategy");
and also using the configuration
Code:
<property name="hibernate.ejb.naming_strategy">org.hibernate.cfg.DefaultComponentSafeNamingStrategy</property>
in my hibernate.cfg.xml but to no avail. When I use @EmbeddedID with @Embeddable I get the <variableName_> prefix in the db table. I am using Hibernate 3.5.1-Final. Other possibly relevant information is that I am using Envers, all of this is running under Tapestry, against a MySQL database.

Can anyone share any pointers / gotchas? Thanks.

Regards,
Jim.


Top
 Profile  
 
 Post subject: Re: org.hibernate.cfg.DefaultComponentSafeNamingStrategy
PostPosted: Wed Jun 30, 2010 8:17 am 
Newbie

Joined: Wed Jun 30, 2010 4:20 am
Posts: 3
This appears to work when setting the naming strategy programmatically using
Code:
configuration.setNamingStrategy(new DefaultComponentSafeNamingStrategy());
but doesn't appear to work when using
Code:
configuration.setProperty("hibernate.ejb.naming_strategy", "org.hibernate.cfg.DefaultComponentSafeNamingStrategy");
or using
Code:
<property name="hibernate.ejb.naming_strategy">org.hibernate.cfg.DefaultComponentSafeNamingStrategy</property>
within hibernate.cfg.xml.

I would be very interested in hearing why this is if anyone has the answer.


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.