@Override public String guessEntityName(Object entity) throws HibernateException { return delegate.guessEntityName( entity ); }
toEntityName = session.guessEntityName( value );
public String guessEntityName(Object paramObject) throws HibernateException { return ((SessionImplementor) delegate).guessEntityName(paramObject); }
@Override public String guessEntityName(Object entity) throws HibernateException { return delegate.guessEntityName( entity ); }
public String guessEntityName(Object entity) throws HibernateException { return session.guessEntityName(entity); }
@Override public String guessEntityName(final Object entity) throws HibernateException { return getSessionImplementor().guessEntityName(entity); }
private void logCannotResolveNonNullableTransientDependencies(SessionImplementor session) { for ( Map.Entry<Object,Set<AbstractEntityInsertAction>> entry : dependentActionsByTransientEntity.entrySet() ) { Object transientEntity = entry.getKey(); String transientEntityName = session.guessEntityName( transientEntity ); Serializable transientEntityId = session.getFactory().getEntityPersister( transientEntityName ).getIdentifier( transientEntity, session ); String transientEntityString = MessageHelper.infoString( transientEntityName, transientEntityId ); Set<String> dependentEntityStrings = new TreeSet<String>(); Set<String> nonNullableTransientPropertyPaths = new TreeSet<String>(); for ( AbstractEntityInsertAction dependentAction : entry.getValue() ) { dependentEntityStrings.add( MessageHelper.infoString( dependentAction.getEntityName(), dependentAction.getId() ) ); for ( String path : dependenciesByAction.get( dependentAction ).getNonNullableTransientPropertyPaths( transientEntity ) ) { String fullPath = new StringBuilder( dependentAction.getEntityName().length() + path.length() + 1 ) .append( dependentAction.getEntityName() ) .append( '.' ) .append( path ) .toString(); nonNullableTransientPropertyPaths.add( fullPath ); } } LOG.cannotResolveNonNullableTransientDependencies( transientEntityString, dependentEntityStrings, nonNullableTransientPropertyPaths ); } }
private void logCannotResolveNonNullableTransientDependencies(SessionImplementor session) { for ( Map.Entry<Object,Set<AbstractEntityInsertAction>> entry : dependentActionsByTransientEntity.entrySet() ) { Object transientEntity = entry.getKey(); String transientEntityName = session.guessEntityName( transientEntity ); Serializable transientEntityId = session.getFactory().getEntityPersister( transientEntityName ).getIdentifier( transientEntity, session ); String transientEntityString = MessageHelper.infoString( transientEntityName, transientEntityId ); Set<String> dependentEntityStrings = new TreeSet<String>(); Set<String> nonNullableTransientPropertyPaths = new TreeSet<String>(); for ( AbstractEntityInsertAction dependentAction : entry.getValue() ) { dependentEntityStrings.add( MessageHelper.infoString( dependentAction.getEntityName(), dependentAction.getId() ) ); for ( String path : dependenciesByAction.get( dependentAction ).getNonNullableTransientPropertyPaths( transientEntity ) ) { String fullPath = new StringBuilder( dependentAction.getEntityName().length() + path.length() + 1 ) .append( dependentAction.getEntityName() ) .append( '.' ) .append( path ) .toString(); nonNullableTransientPropertyPaths.add( fullPath ); } } LOG.cannotResolveNonNullableTransientDependencies( transientEntityString, dependentEntityStrings, nonNullableTransientPropertyPaths ); } }
throw new TransientPropertyValueException( "Not-null property references a transient value - transient instance must be saved before current operation", firstDependentAction.getSession().guessEntityName( firstTransientDependency ), firstDependentAction.getEntityName(), firstPropertyPath
throw new TransientPropertyValueException( "Not-null property references a transient value - transient instance must be saved before current operation", firstDependentAction.getSession().guessEntityName( firstTransientDependency ), firstDependentAction.getEntityName(), firstPropertyPath
throw new TransientObjectException( "object references an unsaved transient instance - save the transient instance before flushing: " + (entityName == null ? session.guessEntityName( object ) : entityName) );
throw new TransientObjectException( "object references an unsaved transient instance - save the transient instance before flushing: " + (entityName == null ? session.guessEntityName( object ) : entityName) );
toEntityName = session.guessEntityName( value );