Interface PkGenerator

    • Method Detail

      • createAutoPk

        void createAutoPk​(DataNode node,
                          List<DbEntity> dbEntities)
                   throws Exception
        Generates necessary database objects to provide automatic primary key support.
        Parameters:
        node - node that provides access to a DataSource.
        dbEntities - a list of entities that require primary key auto-generation support
        Throws:
        Exception
      • createAutoPkStatements

        List<String> createAutoPkStatements​(List<DbEntity> dbEntities)
        Returns a list of SQL strings needed to generates database objects to provide automatic primary support for the list of entities. No actual database operations are performed.
      • dropAutoPk

        void dropAutoPk​(DataNode node,
                        List<DbEntity> dbEntities)
                 throws Exception
        Drops any common database objects associated with automatic primary key generation process. This may be lookup tables, special stored procedures or sequences.
        Parameters:
        node - node that provides access to a DataSource.
        dbEntities - a list of entities whose primary key auto-generation support should be dropped.
        Throws:
        Exception
      • dropAutoPkStatements

        List<String> dropAutoPkStatements​(List<DbEntity> dbEntities)
        Returns SQL string needed to drop database objects associated with automatic primary key generation. No actual database operations are performed.
      • reset

        void reset()
        Resets any cached primary keys forcing generator to go to the database next time id generation is requested. May not be applicable for all generator implementations.