org.janux.bus.persistence
Class EntityNotFoundException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.janux.bus.persistence.EntityNotFoundException
- All Implemented Interfaces:
- Serializable
public class EntityNotFoundException
- extends RuntimeException
RuntimeException used to denote that we could not load an Entity from persistence using its
primary key or natural key, although we expected the entity to exist; used to denote an
application error, rather than, for example, a mistyped business code on a UI.
In this respect, Janux uses the following semantic conventions, mostly inspired by the hibernate
project:
- methods prefixed with
find
return null if the entity cannot be materialized
- methods prefixed with
load
throw this EntityNotFoundException if the entity cannot be materialized
The first type of method would be used, for example, when attempting to retrieve an entity using
a business identifier that was supplied by a user on a UI. It is possible that the identifier
was mistyped, and the failure to find the Entity is not necessarely an application error.
The second type of method may be used to deep load an Entity after an initial query returns a
collection of instances of the same class, for example when the user performs a boolean search
using keywords (find all people with a Paris address). Under such circumstances, and discounting
infrastructure exceptions, the failure to find an entity that is known to exist most likely points to
an application error. It is this sort of scenario that this exception is meant to represent.
- Version:
- $Revision: 1.5 $ - $Date: 2006-10-28 04:13:08 $
- Author:
- Philippe Paravicini
- See Also:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
EntityNotFoundException
public EntityNotFoundException()
EntityNotFoundException
public EntityNotFoundException(String msg)
EntityNotFoundException
public EntityNotFoundException(Throwable cause)
EntityNotFoundException
public EntityNotFoundException(String msg,
Throwable cause)
Copyright © 2005-2013 Janux. All Rights Reserved.