Interface NativeSqlStrategy

All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
DefaultApplicationOwnedCatalogNativeSqlStrategy, DefaultMultiRootCatalogGraphNativeSqlStrategy, DefaultMultiTopDownCatalogGraphNativeSqlStrategy, HsqlApplicationOwnedCatalogNativeSqlStrategy, HsqlMultiRootCatalogGraphNativeSqlStrategy, HsqlMultiTopDownCatalogGraphNativeSqlStrategy, OracleApplicationOwnedCatalogNativeSqlStrategy, OracleMultiRootCatalogGraphNativeSqlStrategy, OracleMultiTopDownCatalogGraphNativeSqlStrategy

public interface NativeSqlStrategy extends org.springframework.core.Ordered
In some cases, native SQL is required to perform specialized database operations. For example, we use this in order to walk relationship graphs using CTE recursive queries written in platform specific syntax. This structure allows registration in Spring of a strategy for query generation specific to database platform.

Note, the general pattern for override of an existing strategy is to declare a new valid strategy of the same name with a lesser order. That strategy with the lesser order will be picked up first and used instead.

Author:
Jeff Fischer
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    The name of the strategy
    default int
     
    The fully formed SQL query
    boolean
    isValid(jakarta.persistence.EntityManager em)
    Is this strategy valid for the given entity manager.
  • Method Details

    • isValid

      boolean isValid(jakarta.persistence.EntityManager em)
      Is this strategy valid for the given entity manager.
      Parameters:
      em - The entity manager instance to check
      Returns:
      Whether or not this strategy is valid
    • getName

      String getName()
      The name of the strategy
      Returns:
      The name of the strategy
    • getSql

      String getSql(Map<String,Object> args)
      The fully formed SQL query
      Parameters:
      args - Arguments passed to the strategy that could be useful during sql generation
      Returns:
      The fully formed SQL query
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered