1 package org.hibernate; 3 4 8 public class QueryException extends HibernateException { 9 10 private String queryString; 11 12 public QueryException(String message) { 13 super(message); 14 } 15 public QueryException(String message, Throwable e) { 16 super(message, e); 17 } 18 19 public QueryException(String message, String queryString) { 20 super(message); 21 this.queryString = queryString; 22 } 23 24 public QueryException(Exception e) { 25 super(e); 26 } 27 public String getQueryString() { 28 return queryString; 29 } 30 31 public void setQueryString(String queryString) { 32 this.queryString = queryString; 33 } 34 35 public String getMessage() { 36 String msg = super.getMessage(); 37 if ( queryString!=null ) msg += " [" + queryString + ']'; 38 return msg; 39 } 40 41 } 42 43 44 45 46 47 48 49 | Popular Tags |