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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HasReferenceException(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.String
getDefaultErrorCode()
String
getDefaultMessageKey()
de.xima.cmn.dao.interfaces.IEntity<Long>
getEntity()
String
getLocalizedMessage(Locale locale)
Map<Class<? extends de.xima.cmn.dao.interfaces.IEntity<Long>>,Set<de.xima.cmn.dao.interfaces.IEntity<Long>>>
getRefEntities()
-
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 Detail
-
HasReferenceException
public HasReferenceException(de.xima.cmn.dao.interfaces.IEntity<Long> entity)
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
public 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.- Parameters:
entity
- The entity that is still referenced by other entities.cause
- An exception that is the cause of this exception.
-
HasReferenceException
public 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.- 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 Detail
-
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
public de.xima.cmn.dao.interfaces.IEntity<Long> getEntity()
- Returns:
- The entity which is still referenced by other entities.
-
getDefaultMessageKey
public String getDefaultMessageKey()
-
getDefaultErrorCode
public String getDefaultErrorCode()
-
getLocalizedMessage
public String getLocalizedMessage(Locale locale)
- Specified by:
getLocalizedMessage
in interfacede.xima.cmn.dao.exceptions.interfaces.IDaoException
- Overrides:
getLocalizedMessage
in classde.xima.cmn.dao.exceptions.AbstractDaoRuntimeException
-
addEntites
public void addEntites(de.xima.cmn.dao.interfaces.IEntity<Long>... entities)
Adds the given entities to the list of referenced entities.- Parameters:
entities
- Entities to add.
-
addEntites
public void addEntites(Collection<? extends de.xima.cmn.dao.interfaces.IEntity<Long>> entities)
Adds the given entities to the list of referenced entities.- Parameters:
entities
- Entities to add.
-
-