Interface ScriptHelper

  • All Known Implementing Classes:
    ScriptHelperImpl

    public interface ScriptHelper
    Helper for script execution
    • Method Detail

      • addOnCommit

        void addOnCommit​(Runnable runnable)
        Adds a listener to be executed when the main transaction commits, which is not executed in a database transaction
      • addOnCommitTransactional

        void addOnCommitTransactional​(Runnable runnable)
        Adds a listener to be executed when the main transaction commits, which is executed inside a new transaction
      • addOnRollback

        void addOnRollback​(Runnable runnable)
        Adds a listener to be executed when the main transaction rollbacks, which is not executed in a database transaction
      • addOnRollbackTransactional

        void addOnRollbackTransactional​(Runnable runnable)
        Adds a listener to be executed when the main transaction is rolled-back, which is executed inside a new transaction
      • bean

        <T> T bean​(Class<T> beanType)
        Returns a bean by type
      • getApplicationContext

        ApplicationContext getApplicationContext()
        Returns the Spring application context
      • maskId

        Long maskId​(Object id)
        Returns a value suitable to be sent to clients, which represents the given entity identifier
      • processBatch

        <T> long processBatch​(Iterable<T> iterable,
                              Consumer<T> closure)
        See QueryHelper#processBatch(CloseableIterator, Consumer, BaseEntityManagerHandler)
      • processBatch

        <T> long processBatch​(Iterator<T> iterator,
                              Consumer<T> closure)
        See QueryHelper#processBatch(CloseableIterator, Consumer, BaseEntityManagerHandler)
      • unmaskId

        Long unmaskId​(Object id)
        Returns a value suitable to be used on server side, given the argument is a masked identifier
      • wrap

        Map<String,​Object> wrap​(Object object,
                                      Collection<? extends CustomField<?,​?,​?>> customFields)
        Same as wrap(Object), but providing an explicit custom fields collection, instead of trying to get from the object. Is useful, for example, when creating a new entity / DTO, when it doesn't yet have a list of custom values