Re: Configuration.addPackage(...)

2014-01-16 Thread Thiago H de Paula Figueiredo
On Thu, 16 Jan 2014 03:21:53 -0200, nhhockeyplayer nashua  
 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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



RE: Configuration.addPackage(...)

2014-01-15 Thread nhhockeyplayer nashua
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(...)

2014-01-15 Thread Dmitry Gusev
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 <
nhhockeypla...@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(...)

2014-01-15 Thread nhhockeyplayer nashua
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(...)

2014-01-15 Thread nhhockeyplayer nashua
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: nhhockeypla...@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.

4.3.0.Final

Best regards 
and thanks... KEN