public boolean doProcess() { return log.isDebugEnabled(); }
void addJoinByPathMap(String path, FromElement destination) { if ( LOG.isDebugEnabled() ) { LOG.debugf( "addJoinByPathMap() : %s -> %s", path, destination.getDisplayText() ); } fromElementsByPath.put( path, destination ); }
@Override public void markRollbackOnly() { if ( getStatus() != TransactionStatus.ROLLED_BACK ) { if ( log.isDebugEnabled() ) { log.debug( "JDBC transaction marked for rollback-only (exception provided for stack trace)", new Exception( "exception just for purpose of providing stack trace" ) ); } rollbackOnly = true; } } }
private static void logQuery(String hql, String sql) { if ( LOG.isDebugEnabled() ) { LOG.debugf( "HQL: %s", hql ); LOG.debugf( "SQL: %s", sql ); } }
void showHqlAst(AST hqlAst) { if ( LOG.isDebugEnabled() ) { LOG.debug( TokenPrinters.HQL_TOKEN_PRINTER.showAsString( hqlAst, "--- HQL AST ---" ) ); } }
@Override public void evictQueryRegions() { if ( LOG.isDebugEnabled() ) { LOG.debug( "Evicting cache of all query regions." ); } evictQueryResultRegion( defaultQueryResultsCache ); for ( QueryResultsCache cache : namedQueryResultsCacheMap.values() ) { evictQueryResultRegion( cache ); } }
public void toString(Iterable<Map.Entry<EntityKey, Object>> entitiesByEntityKey) throws HibernateException { if ( !LOG.isDebugEnabled() || !entitiesByEntityKey.iterator().hasNext() ) { return; } LOG.debug( "Listing entities:" ); int i = 0; for ( Map.Entry<EntityKey, Object> entityKeyAndEntity : entitiesByEntityKey ) { if ( i++ > 20 ) { LOG.debug( "More......" ); break; } LOG.debug( toString( entityKeyAndEntity.getKey().getEntityName(), entityKeyAndEntity.getValue() ) ); } }
public void setResolved() { this.resolved = true; if ( LOG.isDebugEnabled() ) { LOG.debugf( "Resolved : %s -> %s", this.getPath(), this.getText() ); } }
private void evictNaturalIdData(NavigableRole rootEntityRole, NaturalIdDataAccess cacheAccess) { if ( cacheAccess == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting natural-id cache: %s", rootEntityRole.getFullPath() ); } cacheAccess.evictAll(); }
private void evictCollectionData(NavigableRole navigableRole, CollectionDataAccess cacheAccess) { if ( cacheAccess == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting second-level cache: %s", navigableRole.getFullPath() ); } cacheAccess.evictAll(); }
private void evictEntityData(NavigableRole navigableRole, EntityDataAccess cacheAccess) { if ( cacheAccess == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting entity cache: %s", navigableRole.getFullPath() ); } cacheAccess.evictAll(); }
public SessionFactory getSessionFactory(String uuid) { LOG.debugf( "Lookup: uid=%s", uuid ); final SessionFactory sessionFactory = sessionFactoryMap.get( uuid ); if ( sessionFactory == null && LOG.isDebugEnabled() ) { LOG.debugf( "Not found: %s", uuid ); LOG.debugf( sessionFactoryMap.toString() ); } return sessionFactory; }
private void processLiteral(AST constant) { String replacement = (String) walker.getTokenReplacements().get( constant.getText() ); if ( replacement != null ) { if ( LOG.isDebugEnabled() ) { LOG.debugf( "processConstant() : Replacing '%s' with '%s'", constant.getText(), replacement ); } constant.setText( replacement ); } }
private void evictQueryResultRegion(QueryResultsCache cache) { if ( cache == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting query cache, region: %s", cache.getRegion().getName() ); } cache.clear(); }
private static void bindAnyMetaDef(AnyMetaDef defAnn, MetadataBuildingContext context) { if ( isEmptyAnnotationValue( defAnn.name() ) ) { //don't map not named definitions return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Binding Any Meta definition: %s", defAnn.name() ); } context.getMetadataCollector().addAnyMetaDef( defAnn ); }
@Override public void handlePrimaryExpressionDotIdent() throws TokenStreamException { if ( LA( 2 ) == DOT && LA( 3 ) != IDENT ) { // See if the second lookahead token can be an identifier. HqlToken t = (HqlToken) LT( 3 ); if ( t.isPossibleID() ) { // Set it! t.setType( IDENT ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "handleDotIdent() : new LT(3) token - %s", LT( 1 ) ); } } } }
private HqlSqlWalker analyze(HqlParser parser, String collectionRole) throws QueryException, RecognitionException { final HqlSqlWalker w = new HqlSqlWalker( this, factory, parser, tokenReplacements, collectionRole ); final AST hqlAst = parser.getAST(); // Transform the tree. w.statement( hqlAst ); if ( LOG.isDebugEnabled() ) { LOG.debug( TokenPrinters.SQL_TOKEN_PRINTER.showAsString( w.getAST(), "--- SQL AST ---" ) ); } w.getParseErrorHandler().throwQueryException(); return w; }
@Override public void evictEntityData(String entityName, Serializable identifier) { final EntityPersister entityDescriptor = sessionFactory.getMetamodel().entityPersister( entityName ); final EntityDataAccess cacheAccess = entityDescriptor.getCacheAccessStrategy(); if ( cacheAccess == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting second-level cache: %s", MessageHelper.infoString( entityDescriptor, identifier, sessionFactory ) ); } final Object key = cacheAccess.generateCacheKey( identifier, entityDescriptor, sessionFactory, null ); cacheAccess.evict( key ); }
@Override public void handleDotIdent() throws TokenStreamException { // This handles HHH-354, where there is a strange property name in a where clause. // If the lookahead contains a DOT then something that isn't an IDENT... if ( LA( 1 ) == DOT && LA( 2 ) != IDENT ) { // See if the second lookahead token can be an identifier. HqlToken t = (HqlToken) LT( 2 ); if ( t.isPossibleID() ) { // Set it! LT( 2 ).setType( IDENT ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "handleDotIdent() : new LT(2) token - %s", LT( 1 ) ); } } } }
protected void logStaticSQL() { if ( LOG.isDebugEnabled() ) { LOG.debugf( "Static SQL for collection: %s", getRole() ); if ( getSQLInsertRowString() != null ) { LOG.debugf( " Row insert: %s", getSQLInsertRowString() ); } if ( getSQLUpdateRowString() != null ) { LOG.debugf( " Row update: %s", getSQLUpdateRowString() ); } if ( getSQLDeleteRowString() != null ) { LOG.debugf( " Row delete: %s", getSQLDeleteRowString() ); } if ( getSQLDeleteString() != null ) { LOG.debugf( " One-shot delete: %s", getSQLDeleteString() ); } } }