程序包 org.hibernate

接口 SynchronizeableQuery<T>

  • 所有已知子接口:
    NativeQuery<T>, NativeQueryImplementor<T>, ProcedureCall, ProcedureCallImplementor<R>, SQLQuery<T>
    所有已知实现类:
    NativeQueryImpl, ProcedureCallImpl

    public interface SynchronizeableQuery<T>
    A unifying interface for queries which can define tables (query spaces) to synchronize on. These query spaces affect the process of auto-flushing by determining which entities will be processed by auto-flush based on the table to which those entities are mapped and which are determined to have pending state changes. In a similar manner, these query spaces also affect how query result caching can recognize invalidated results.
    作者:
    Steve Ebersole
    • 方法详细资料

      • getSynchronizedQuerySpaces

        Collection<String> getSynchronizedQuerySpaces()
        Obtain the list of query spaces the query is synchronized on.
        返回:
        The list of query spaces upon which the query is synchronized.
      • addSynchronizedQuerySpace

        SynchronizeableQuery<T> addSynchronizedQuerySpace​(String querySpace)
        Adds a query space.
        参数:
        querySpace - The query space to be auto-flushed for this query.
        返回:
        this, for method chaining
      • addSynchronizedEntityName

        SynchronizeableQuery<T> addSynchronizedEntityName​(String entityName)
                                                   throws MappingException
        Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. Same as addSynchronizedQuerySpace(java.lang.String) for all tables associated with the given entity.
        参数:
        entityName - The name of the entity upon whose defined query spaces we should additionally synchronize.
        返回:
        this, for method chaining
        抛出:
        MappingException - Indicates the given name could not be resolved as an entity
      • addSynchronizedEntityClass

        SynchronizeableQuery<T> addSynchronizedEntityClass​(Class entityClass)
                                                    throws MappingException
        Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. Same as addSynchronizedQuerySpace(java.lang.String) for all tables associated with the given entity.
        参数:
        entityClass - The class of the entity upon whose defined query spaces we should additionally synchronize.
        返回:
        this, for method chaining
        抛出:
        MappingException - Indicates the given class could not be resolved as an entity