Class NonNullableTransientDependencies


  • public final class NonNullableTransientDependencies
    extends Object
    Tracks non-nullable transient entities that would cause a particular entity insert to fail.
    • Constructor Detail

      • NonNullableTransientDependencies

        public NonNullableTransientDependencies()
    • Method Detail

      • add

        public void add​(String propertyName,
                        Object transientEntity)
      • getNonNullableTransientEntities

        public Iterable<Object> getNonNullableTransientEntities()
      • getNonNullableTransientPropertyPaths

        public Iterable<String> getNonNullableTransientPropertyPaths​(Object entity)
        Retrieve the paths that refer to the transient entity
        Parameters:
        entity - The transient entity
        Returns:
        The property paths
      • isEmpty

        public boolean isEmpty()
        Are there any paths currently tracked here?
        Returns:
        true indicates there are no path tracked here currently
      • resolveNonNullableTransientEntity

        public void resolveNonNullableTransientEntity​(Object entity)
        Clean up any tracked references for the given entity, throwing an exception if there were any paths.
        Parameters:
        entity - The entity
        Throws:
        IllegalStateException - If the entity had tracked paths
      • toLoggableString

        public String toLoggableString​(SharedSessionContractImplementor session)
        Build a loggable representation of the paths tracked here at the moment.
        Parameters:
        session - The session (used to resolve entity names)
        Returns:
        The loggable representation