-->
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.  [ 3 posts ] 
Author Message
 Post subject: ImprovedNamingStrategy singleton problem
PostPosted: Wed Aug 10, 2005 12:58 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 5:15 am
Posts: 21
Hi,

I was trying to set up an ant task to create the schema using the ImprovedNamingStrategy class.

Code:
      namingStrategy="org.hibernate.cfg.ImprovedNamingStrategy">


Since I was getting an exception (Class org.hibernate.tool.hbm2ddl.SchemaExportTask can not access a member of class org.hibernate.cfg.ImprovedNamingStrategy with modifiers "protected"), I took a look at SchemaExport task. This is what it tries to do:

Code:
      if (namingStrategy!=null) cfg.setNamingStrategy(
         (NamingStrategy) ReflectHelper.classForName(namingStrategy).newInstance()
      );


Unfortunately ImprovedNamingStrategy its a singleton and has the following constructor:

Code:
      protected ImprovedNamingStrategy() {}


If this is a bug, could it be fixed ? Since the constructor is protected at least you can extend it with an empty class and use it as the NamingStrategy, but this is just a hack and not something you want to keep in your codebase.

Best regards,

- Juan


Top
 Profile  
 
 Post subject: Bug ?
PostPosted: Thu Aug 11, 2005 11:38 am 
Beginner
Beginner

Joined: Thu Jun 30, 2005 5:15 am
Posts: 21
Should I report a bug for this on Jira ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 12:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
OK, I made the constructor public in CVS.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.