1 package org.hibernate; 3 4 import java.io.Serializable ; 5 6 14 public class WrongClassException extends HibernateException { 15 16 private final Serializable identifier; 17 private final String entityName; 18 19 public WrongClassException(String msg, Serializable identifier, String clazz) { 20 super(msg); 21 this.identifier = identifier; 22 this.entityName = clazz; 23 } 24 public Serializable getIdentifier() { 25 return identifier; 26 } 27 28 public String getMessage() { 29 return "Object with id: " + 30 identifier + 31 " was not of the specified subclass: " + 32 entityName + 33 " (" + super.getMessage() + ")" ; 34 } 35 36 public String getEntityName() { 37 return entityName; 38 } 39 40 } 41 42 43 44 45 46 47 48 | Popular Tags |