Class TemplatedViolatedConstraintNameExtractor

    • Constructor Detail

      • TemplatedViolatedConstraintNameExtractor

        public TemplatedViolatedConstraintNameExtractor​(Function<SQLException,​String> extractConstraintName)
    • Method Detail

      • extractUsingTemplate

        public static @Nullable String extractUsingTemplate​(String templateStart,
                                                            String templateEnd,
                                                            String message)
        Extracts the constraint name based on a template of form templateStartconstraintNametemplateEnd.
        templateStart - The pattern denoting the start of the constraint name within the message.
        templateEnd - The pattern denoting the end of the constraint name within the message.
        message - The templated error message containing the constraint name.
        The found constraint name, or null.