Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.5
Code :
Code:
Statistics stats = sessionFactory.getStatistics();
String[] queries = stats.getQueries();
//queries statistics
if (queries != null && queries.length > 0)
{
for (int i=0;i<queries.length;i++)
{
.......
Full stack trace of any exception that occurs:no exception , but queries is NULL
Solution:i trace the code and found that getQueryIdentifier() in org.hibernate.loader.Loader doesn't be implemented.
i code it to :
Code:
protected String getQueryIdentifier()
{
return getSQLString();
}
and then , statistics is running good.
what i wonder is why getQueryIdentifier() is not completed and what i impelemennts is right?