
net.smartlab.web.UndefinedKeyException Maven / Gradle / Ivy
/*
* The SmartWeb Framework
* Copyright (C) 2004-2006
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* For further informations on the SmartWeb Framework please visit
*
* http://smartweb.sourceforge.net
*/
package net.smartlab.web;
import java.io.Serializable;
/**
* An UndefinedKeyException is thrown whenever an application tries to retrieve
* from a persistent storage an entity using the unique identifier, also
* known as primary key or simply key, and the requested
* identifing value is not present in the storage system.
*
* @author rlogiacco
*/
public class UndefinedKeyException extends DAOException {
private final static long serialVersionUID = 4418831216086543320L;
/**
* The key not found on the database.
*
* @uml.property name="key"
*/
private Serializable key;
/**
* The class referred by the search.
*
* @uml.property name="type"
*/
private Class type;
/**
* Constructs a new instance with the key and type not found in the
* repository and originating exception.
*
* @param key the key not found in the repository.
* @param type the class of the key not found in the repository.
* @param cause the originating exception.
*/
public UndefinedKeyException(Serializable key, Class type, Throwable cause) {
super("persistence.error.select", cause);
this.key = key;
this.type = type;
}
/**
* Constructs a new instance with the key and type not found in the
* repository.
*
* @param key the key not found in the repository.
* @param type the class of the key not found in the repository.
*/
public UndefinedKeyException(Serializable key, Class type) {
super("persistence.error.select");
this.key = key;
this.type = type;
}
/**
* Returns the key.
*
* @return the key.
* @uml.property name="key"
*/
public Serializable getKey() {
return key;
}
/**
* Returns the type.
*
* @return the type.
* @uml.property name="type"
*/
public Class getType() {
return type;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy