Interface TableSetInfoProvider


  • public interface TableSetInfoProvider
    Mechanism for creating TableSetInfo from a group of DBTableInfos. The implementor can recognize its tables and can create from them a proper instance of TableSetInfo. The TableSetInfo can be promoted to Entity.
    Since:
    16.2.8
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  TableSetInfoProvider.Context
      The context of the provider, contains informations about the schema.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      com.im.commons.db.ddl.tablesets.TableSetInfo createTableSetInfo​(com.im.commons.db.ddl.DBTableInfo primaryTable, java.util.Map<java.lang.String,​com.im.commons.db.ddl.DBTableInfo> tables)
      Creates TableSetInfo from a group of DBTableInfos.
      com.im.commons.db.ddl.DBTableInfo findPrimaryTable​(com.im.commons.db.ddl.DBTableInfo table, TableSetInfoProvider.Context ctx)
      Should return the primary table related to the table or null if the table is not known by the implementor.
      default void init​(com.im.commons.db.DatabasePlatform platform)
      Initializes provider if needed.
    • Method Detail

      • init

        default void init​(com.im.commons.db.DatabasePlatform platform)
        Initializes provider if needed. Used for JPC/JCC optimization.
        Parameters:
        platform - DB platform
        Since:
        21.15.0
      • findPrimaryTable

        com.im.commons.db.ddl.DBTableInfo findPrimaryTable​(com.im.commons.db.ddl.DBTableInfo table,
                                                           TableSetInfoProvider.Context ctx)
        Should return the primary table related to the table or null if the table is not known by the implementor. For creating TableSetInfo from a group of DBTableInfos the first provider will be used which returned the actually processed primaryTable.
        Parameters:
        table - The table to group with a primary table.
        ctx - The context.
        Returns:
        The primary table of the group where table belongs or null if the table is not known by this implementation.
        See Also:
        createTableSetInfo(com.im.commons.db.ddl.DBTableInfo, java.util.Map)
      • createTableSetInfo

        com.im.commons.db.ddl.tablesets.TableSetInfo createTableSetInfo​(com.im.commons.db.ddl.DBTableInfo primaryTable,
                                                                        java.util.Map<java.lang.String,​com.im.commons.db.ddl.DBTableInfo> tables)
        Creates TableSetInfo from a group of DBTableInfos. The first TableSetInfoProvider will be used to create TableSetInfo which returned the actually processed primaryTable.
        Parameters:
        primaryTable - The primary table of the group.
        tables - Map of tables. The keys are the names of tables including the schema name, the values are DBTableInfos. The keys are case insensitive.
        Returns:
        The created TableSetInfo or null if the group should not be visible.
        See Also:
        findPrimaryTable(com.im.commons.db.ddl.DBTableInfo, com.im.ijcs.api.ddl.TableSetInfoProvider.Context)