constraintviolationexception.java
来自「介绍了hibernate的入门有一些基本常用的事例」· Java 代码 · 共 37 行
JAVA
37 行
// $Id: ConstraintViolationException.java,v 1.2 2004/11/21 00:11:27 pgmjsd Exp $package org.hibernate.exception;import org.hibernate.JDBCException;import java.sql.SQLException;/** * Implementation of JDBCException indicating that the requested DML operation * resulted in a violation of a defined integrity constraint. * * @author Steve Ebersole */public class ConstraintViolationException extends JDBCException { private String constraintName; public ConstraintViolationException(String message, SQLException root, String constraintName) { super( message, root ); this.constraintName = constraintName; } public ConstraintViolationException(String message, SQLException root, String sql, String constraintName) { super( message, root, sql ); this.constraintName = constraintName; } /** * Returns the name of the violated constraint, if known. * * @return The name of the violated constraint, or null if not known. */ public String getConstraintName() { return constraintName; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?