You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nhhockeyplayer nashua <nh...@hotmail.com> on 2014/01/16 05:51:38 UTC
Configuration.addPackage(...)
Hi Folks,
I am using hibernate and tapestry.
Might anyone know what happened to the addPackage method ? Inside class Configuration ?
I am searching thru the javadocs and cannot seem to find it.
<hibernate-version>4.3.0.Final</hibernate-version>
Best regards
and thanks... KEN
RE: Configuration.addPackage(...)
Posted by nhhockeyplayer nashua <nh...@hotmail.com>.
I reimplemented part of it to rreuse the deprecated api
import org.hibernate.cfg.AnnotationConfiguration;
public interface IHibernate4Configurer
{
/**
* Passed the configuration so as to make changes.
*/
void configure(AnnotationConfiguration configuration);
}
public void configure(AnnotationConfiguration configuration)
{
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
for (String packageName : packageManager.getPackageNames())
{
configuration.addPackage(packageName);
for (String className : classNameLocator.locateClassNames(packageName))
{
try
{
Class entityClass = contextClassLoader.loadClass(className);
configuration.addClass(entityClass);
}
catch (ClassNotFoundException ex)
{
throw new RuntimeException(ex);
}
}
}
}
Still caught up on
logger.info(HibernateCoreMessages.startupTiming(configurationComplete - startTime, factoryCreated - startTime));
logger.info(HibernateCoreMessages.entityCatalog(sessionFactory.getAllClassMetadata().keySet()));
not sure what to do with those... I assume deprecated too.
Re: Configuration.addPackage(...)
Posted by Dmitry Gusev <dm...@gmail.com>.
Why don't you ask it on Hibernate mailing list?
http://hibernate.org/community/
This isn't related to Tapestry at all.
On Thu, Jan 16, 2014 at 9:21 AM, nhhockeyplayer nashua <
nhhockeyplayer@hotmail.com> wrote:
> It seems there is frustration about hibernate ansd the deprecation of the
> addPackage method.
>
> And no immediate documented solution to adding a blanket package to a
> Configuration in order to iterate all the classes.
>
> Does anyone know how to do this ?
>
> I know this might be the wrong board. But the hibernate support in
> tapestry is relevent.
>
> Any help is appreciated.
>
> I need a workiarond for addPackage.
>
> Here is a code snippet.
>
> Thanks in advance
>
> Ken
>
> public void configure(Configuration configuration)
> {
> ClassLoader contextClassLoader =
> Thread.currentThread().getContextClassLoader();
>
> for (String packageName : packageManager.getPackageNames())
> {
> configuration.addPackage(packageName); // *** refuses to
> compile...method undefined **//
>
> for (String className :
> classNameLocator.locateClassNames(packageName))
> {
> try
> {
> Class entityClass =
> contextClassLoader.loadClass(className);
>
> configuration.addClass(entityClass);
> }
> catch (ClassNotFoundException ex)
> {
> throw new RuntimeException(ex);
> }
> }
> }
> }
>
--
Dmitry Gusev
AnjLab Team
http://anjlab.com
Re: Configuration.addPackage(...)
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 16 Jan 2014 03:21:53 -0200, nhhockeyplayer nashua
<nh...@hotmail.com> wrote:
> I know this might be the wrong board.
So why did you still post the message? You're just polluting the mailing
list with off-topic stuff in this thread.
> But the hibernate support in tapestry is relevent.
What you've posted isn't related to Hibernate support in Tapestry at all.
It's just about Hibernate.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Configuration.addPackage(...)
Posted by nhhockeyplayer nashua <nh...@hotmail.com>.
It seems there is frustration about hibernate ansd the deprecation of the addPackage method.
And no immediate documented solution to adding a blanket package to a Configuration in order to iterate all the classes.
Does anyone know how to do this ?
I know this might be the wrong board. But the hibernate support in tapestry is relevent.
Any help is appreciated.
I need a workiarond for addPackage.
Here is a code snippet.
Thanks in advance
Ken
public void configure(Configuration configuration)
{
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
for (String packageName : packageManager.getPackageNames())
{
configuration.addPackage(packageName); // *** refuses to compile...method undefined **//
for (String className : classNameLocator.locateClassNames(packageName))
{
try
{
Class entityClass = contextClassLoader.loadClass(className);
configuration.addClass(entityClass);
}
catch (ClassNotFoundException ex)
{
throw new RuntimeException(ex);
}
}
}
}
RE: Configuration.addPackage(...)
Posted by nhhockeyplayer nashua <nh...@hotmail.com>.
Sorry to pollute the board...
It seems to be deprecated but there are no instructions as what to use in place of the deprecated method ?
When I look at the class in eclipse... the method is not in the class.
Best regards
and thanks... KEN
From: nhhockeyplayer@hotmail.com
To: users@tapestry.apache.org
Subject: Configuration.addPackage(...)
Date: Wed, 15 Jan 2014 23:51:38 -0500
Hi Folks,
I am using hibernate and tapestry.
Might anyone know what happened to the addPackage method ? Inside class Configuration ?
I am searching thru the javadocs and cannot seem to find it.
<hibernate-version>4.3.0.Final</hibernate-version>
Best regards
and thanks... KEN