Package de.xima.fc.exceptions
Class HasReferenceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
de.xima.cmn.dao.exceptions.AbstractDaoRuntimeException
de.xima.cmn.dao.exceptions.DatabaseAccessException
de.xima.fc.exceptions.HasReferenceException
- All Implemented Interfaces:
de.xima.cmn.dao.exceptions.interfaces.IDaoException
,Serializable
public class HasReferenceException
extends de.xima.cmn.dao.exceptions.DatabaseAccessException
An exception that indicates that a certain operation cannot be performed on an entity, due to that entity still being
reference by other entities.
The operation is usually a delete operation. For example, a file cannot be deleted in case that file is still used by a workflow action.
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, de.xima.cmn.dao.interfaces.IEntity<Long>... entities) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, String message) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, String messageKey, Serializable... params) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, String message, Throwable cause) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, de.xima.cmn.dao.interfaces.IEntity<Long>... entities) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String messageKey) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String message, de.xima.cmn.dao.interfaces.IEntity<Long>... entities) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String messageKey, Serializable... params) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String message, Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities) Creates a new reference exception for when some entities still reference a certain entity.HasReferenceException
(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities) Creates a new reference exception for when some entities still reference a certain entity. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntites
(de.xima.cmn.dao.interfaces.IEntity<Long>... entities) Adds the given entities to the list of referenced entities.void
addEntites
(Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities) Adds the given entities to the list of referenced entities.de.xima.cmn.dao.interfaces.IEntity<Long>
getLocalizedMessage
(Locale locale) Map<Class<? extends de.xima.cmn.dao.interfaces.IEntity<Long>>,
Set<de.xima.cmn.dao.interfaces.IEntity<Long>>> Methods inherited from class de.xima.cmn.dao.exceptions.AbstractDaoRuntimeException
getErrorCode, getExceptionData, getMessageKey, getMessageParams
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HasReferenceException
Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.
-
HasReferenceException
Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.
-
HasReferenceException
Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.message
- A localized error message.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.entities
- A list of entities that still reference the given entity.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, de.xima.cmn.dao.interfaces.IEntity<Long>... entities) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.entities
- A list of entities that still reference the given entity.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, String message, Throwable cause) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.message
- A localized error message.cause
- An exception that is the cause of this exception.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String messageKey) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.messageKey
- I18N key for constructing a localized error message
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, de.xima.cmn.dao.interfaces.IEntity<Long>... entities) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.entities
- A list of entities that still reference the given entity.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.entities
- A list of entities that still reference the given entity.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, String messageKey, Serializable... params) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.messageKey
- I18N key for constructing a localized error messageparams
- Parameters for constructing a localized error message.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String message, de.xima.cmn.dao.interfaces.IEntity<Long>... entities) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.message
- A localized error message.entities
- A list of entities that still reference the given entity.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String message, Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.message
- A localized error message.entities
- A list of entities that still reference the given entity.
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity, Throwable cause, String messageKey, Serializable... params) Creates a new reference exception for when some entities still reference a certain entity.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.messageKey
- I18N key for constructing a localized error messageparams
- Parameters for constructing a localized error message.
-
-
Method Details
-
getRefEntities
public Map<Class<? extends de.xima.cmn.dao.interfaces.IEntity<Long>>,Set<de.xima.cmn.dao.interfaces.IEntity<Long>>> getRefEntities()- Returns:
- The entities that still reference the
getEntity()
.
-
getEntity
- Returns:
- The entity which is still referenced by other entities.
-
getDefaultMessageKey
-
getDefaultErrorCode
-
getLocalizedMessage
- Specified by:
getLocalizedMessage
in interfacede.xima.cmn.dao.exceptions.interfaces.IDaoException
- Overrides:
getLocalizedMessage
in classde.xima.cmn.dao.exceptions.AbstractDaoRuntimeException
-
addEntites
Adds the given entities to the list of referenced entities.- Parameters:
entities
- Entities to add.
-
addEntites
Adds the given entities to the list of referenced entities.- Parameters:
entities
- Entities to add.
-