public abstract class

TemplatedViolatedConstraintNameExtracter

extends Object
implements ViolatedConstraintNameExtracter
java.lang.Object
   ↳ org.hibernate.exception.TemplatedViolatedConstraintNameExtracter

Class Overview

Knows how to extract a violated constraint name from an error message based on the fact that the constraint name is templated within the message.

Summary

Public Constructors
TemplatedViolatedConstraintNameExtracter()
Protected Methods
String extractUsingTemplate(String templateStart, String templateEnd, String message)
Extracts the constraint name based on a template (i.e., templateStartconstraintNametemplateEnd).
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.exception.ViolatedConstraintNameExtracter

Public Constructors

public TemplatedViolatedConstraintNameExtracter ()

Protected Methods

protected String extractUsingTemplate (String templateStart, String templateEnd, String message)

Extracts the constraint name based on a template (i.e., templateStartconstraintNametemplateEnd).

Parameters
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.
Returns
  • The found constraint name, or null.