Package org.hibernate
Class PropertyValueException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- jakarta.persistence.PersistenceException
-
- org.hibernate.HibernateException
-
- org.hibernate.PropertyValueException
-
- All Implemented Interfaces:
Serializable
public class PropertyValueException extends HibernateException
Thrown when the (illegal) value of a property can not be persisted. There are two main causes:- a property declared
@Basic(optional=false)
is null, or - an association references an unsaved transient instance.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertyValueException(String message, String entityName, String propertyName)
Constructs aPropertyValueException
using the specified information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEntityName()
String
getMessage()
String
getPropertyName()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
PropertyValueException
public PropertyValueException(String message, String entityName, String propertyName)
Constructs aPropertyValueException
using the specified information.- Parameters:
message
- A message explaining the exception conditionentityName
- The name of the entity, containing the propertypropertyName
- The name of the property being accessed.
-
-
Method Detail
-
getEntityName
public String getEntityName()
-
getPropertyName
public String getPropertyName()
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
-