private InputSource buildInputSource(String publicId, String systemId, InputStream dtdStream, boolean resolved) { if ( dtdStream == null ) { LOG.tracev( "Unable to locate [{0}] on classpath", systemId ); return null; } LOG.tracev( "Located [{0}] in classpath", systemId ); InputSource source = new InputSource( dtdStream ); source.setPublicId( publicId ); source.setSystemId( systemId ); this.resolved = resolved; return source; }
/** * Serialize this {@link UnresolvedEntityInsertActions} object. * @param oos - the output stream * @throws IOException if there is an error writing this object to the output stream. */ public void serialize(ObjectOutputStream oos) throws IOException { final int queueSize = dependenciesByAction.size(); LOG.tracev( "Starting serialization of [{0}] unresolved insert entries", queueSize ); oos.writeInt( queueSize ); for ( AbstractEntityInsertAction unresolvedAction : dependenciesByAction.keySet() ) { oos.writeObject( unresolvedAction ); } }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to persist: {0}" + entityName ); session.persist( entityName, child, (Map) anything ); }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to evict: {0}", entityName ); session.evict( child ); }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to merge: {0}", entityName ); session.merge( entityName, child, (Map) anything ); }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to save or update: {0}", entityName ); session.saveOrUpdate( entityName, child ); }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to persist on flush: {0}", entityName ); session.persistOnFlush( entityName, child, (Map) anything ); }
private void addPersister(String alias, Map propertyResult, SQLLoadable persister) { alias2Persister.put( alias, persister ); String suffix = generateEntitySuffix(); LOG.tracev( "Mapping alias [{0}] to entity-suffix [{1}]", alias, suffix ); alias2Suffix.put( alias, suffix ); entityPropertyResultMaps.put( alias, propertyResult ); }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) { LOG.tracev( "Cascading to delete: {0}", entityName ); session.delete( entityName, child, isCascadeDeleteEnabled, (Set) anything ); }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to refresh: {0}", entityName ); session.refresh( entityName, child, (Map) anything ); }
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to replicate: {0}", entityName ); session.replicate( entityName, child, (ReplicationMode) anything ); }
@Override public void addImport(String importName, String entityName) { if ( importName == null || entityName == null ) { throw new IllegalArgumentException( "Import name or entity name is null" ); } log.tracev( "Import: {0} -> {1}", importName, entityName ); String old = imports.put( importName, entityName ); if ( old != null ) { log.debug( "import name [" + importName + "] overrode previous [{" + old + "}]" ); } }
private void logDuplicateRegistration(String path, Type existingType, Type type) { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Skipping duplicate registration of path [{0}], existing type = [{1}], incoming type = [{2}]", path, existingType, type ); } }
/** * Adds an entity (IDENTITY) insert action * * @param action The action representing the entity insertion */ public void addAction(EntityIdentityInsertAction action) { LOG.tracev( "Adding an EntityIdentityInsertAction for [{0}] object", action.getEntityName() ); addInsertAction( action ); }
private void logIncompatibleRegistration(String path, Type existingType, Type type) { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Skipped adding attribute [{1}] to base-type [{0}] as more than one sub-type defined the attribute using incompatible types (strictly speaking the attributes are not inherited); existing type = [{2}], incoming type = [{3}]", getEntityName(), path, existingType, type ); } }
/** * Adds an entity insert action * * @param action The action representing the entity insertion */ public void addAction(EntityInsertAction action) { LOG.tracev( "Adding an EntityInsertAction for [{0}] object", action.getEntityName() ); addInsertAction( action ); }
@Override @SuppressWarnings({ "unchecked" }) public void registerLastQuery(Statement statement) { LOG.tracev( "Registering last query statement [{0}]", statement ); if ( statement instanceof JdbcWrapper ) { final JdbcWrapper<Statement> wrapper = (JdbcWrapper<Statement>) statement; registerLastQuery( wrapper.getWrappedObject() ); return; } lastQuery = statement; }
private void addCollection(String role, String alias, Map propertyResults) { SQLLoadableCollection collectionPersister = ( SQLLoadableCollection ) factory.getCollectionPersister( role ); alias2CollectionPersister.put( alias, collectionPersister ); String suffix = generateCollectionSuffix(); LOG.tracev( "Mapping alias [{0}] to collection-suffix [{1}]", alias, suffix ); alias2CollectionSuffix.put( alias, suffix ); collectionPropertyResultMaps.put( alias, propertyResults ); if ( collectionPersister.isOneToMany() || collectionPersister.isManyToMany() ) { SQLLoadable persister = ( SQLLoadable ) collectionPersister.getElementPersister(); addPersister( alias, filter( propertyResults ), persister ); } }
/** * Load an instance using either the <tt>forUpdateLoader</tt> or the outer joining <tt>loader</tt>, * depending upon the value of the <tt>lock</tt> parameter */ public Object load(Serializable id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session) throws HibernateException { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Fetching entity: {0}", MessageHelper.infoString( this, id, getFactory() ) ); } final UniqueEntityLoader loader = getAppropriateLoader( lockOptions, session ); return loader.load( id, optionalObject, session, lockOptions ); }
@Override public void afterStatementExecution() { LOG.tracev( "Starting after statement execution processing [{0}]", getConnectionReleaseMode() ); if ( getConnectionReleaseMode() == ConnectionReleaseMode.AFTER_STATEMENT ) { if ( ! releasesEnabled ) { LOG.debug( "Skipping aggressive release due to manual disabling" ); return; } if ( hasRegisteredResources() ) { LOG.debug( "Skipping aggressive release due to registered resources" ); return; } getLogicalConnection().afterStatement(); } }