KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > QueryException


1 //$Id: QueryException.java,v 1.1 2004/06/03 16:30:04 steveebersole Exp $
2
package org.hibernate;
3
4 /**
5  * A problem occurred translating a Hibernate query to SQL
6  * due to invalid query syntax, etc.
7  */

8 public class QueryException extends HibernateException {
9
10     private String JavaDoc queryString;
11
12     public QueryException(String JavaDoc message) {
13         super(message);
14     }
15     public QueryException(String JavaDoc message, Throwable JavaDoc e) {
16         super(message, e);
17     }
18
19     public QueryException(String JavaDoc message, String JavaDoc queryString) {
20         super(message);
21         this.queryString = queryString;
22     }
23
24     public QueryException(Exception JavaDoc e) {
25         super(e);
26     }
27     public String JavaDoc getQueryString() {
28         return queryString;
29     }
30
31     public void setQueryString(String JavaDoc queryString) {
32         this.queryString = queryString;
33     }
34
35     public String JavaDoc getMessage() {
36         String JavaDoc 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