Top Description Inners Fields Constructors Methods
org.hibernate.engine.internal

public final Class Nullability

extends Object
Class Inheritance
Imports
java.util.Iterator, org.hibernate.HibernateException, .PropertyValueException, org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer, org.hibernate.engine.spi.CascadingActions, .SharedSessionContractImplementor, org.hibernate.persister.entity.EntityPersister, org.hibernate.generator.Generator, org.hibernate.type.CollectionType, .CompositeType, .Type

Implements the algorithm for validating property values for illegal null values
Author
Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private final boolean
private final SharedSessionContractImplementor

Constructor Summary

AccessConstructor and Description
public
Nullability(SharedSessionContractImplementor
The session
session
)

Constructs a Nullability

Method Summary

Modifier and TypeMethod and Description
private static String

Returns:

parent-child path
buildPropertyPath
(String
parent in path
parent
,
String
child in path
child
)

Return a well formed property path.

private String

Returns:

property path
checkComponentNullability
(Object
component properties
value
,
CompositeType
component not-nullable type
compositeType
)

check component nullability.

public void
checkNullability(final Object[]
entity properties
values
,
final EntityPersister
class persister
persister
,
final boolean
whether it is intended to be updated or saved
isUpdate
)

Check nullability of the class persister properties

public void
checkNullability(final Object[] values, final EntityPersister persister, final Nullability.NullabilityCheckType checkType)

private String

Returns:

property path
checkSubElementsNullability
(Type
type to check
propertyType
,
Object
value to check
value
)

check sub elements-nullability.

private static boolean
generated(Generator generator)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkNullabilityback to summary
private final boolean checkNullability
sessionback to summary
private final SharedSessionContractImplementor session

Constructor Detail

Nullabilityback to summary
public Nullability(SharedSessionContractImplementor session)

Constructs a Nullability

Parameters
session:SharedSessionContractImplementor

The session

Method Detail

buildPropertyPathback to summary
private static String buildPropertyPath(String parent, String child)

Return a well formed property path. Basically, it will return parent.child

Parameters
parent:String

parent in path

child:String

child in path

Returns:String

parent-child path

checkComponentNullabilityback to summary
private String checkComponentNullability(Object value, CompositeType compositeType) throws HibernateException

check component nullability. Returns property path that break nullability or null if none

Parameters
value:Object

component properties

compositeType:CompositeType

component not-nullable type

Returns:String

property path

Exceptions
HibernateException:
error while getting subcomponent values
checkNullabilityback to summary
public void checkNullability(final Object[] values, final EntityPersister persister, final boolean isUpdate)

Check nullability of the class persister properties

Parameters
values:Object[]

entity properties

persister:EntityPersister

class persister

isUpdate:boolean

whether it is intended to be updated or saved

Exceptions
PropertyValueException:
Break the nullability of one property
HibernateException:
error while getting Component values
checkNullabilityback to summary
public void checkNullability(final Object[] values, final EntityPersister persister, final Nullability.NullabilityCheckType checkType)
checkSubElementsNullabilityback to summary
private String checkSubElementsNullability(Type propertyType, Object value) throws HibernateException

check sub elements-nullability. Returns property path that break nullability or null if none

Parameters
propertyType:Type

type to check

value:Object

value to check

Returns:String

property path

Exceptions
HibernateException:
error while getting subcomponent values
generatedback to summary
private static boolean generated(Generator generator)
org.hibernate.engine.internal back to summary

public final Enum Nullability.NullabilityCheckType

extends Enum<Nullability.NullabilityCheckType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Nullability.NullabilityCheckType
public static final Nullability.NullabilityCheckType
public static final Nullability.NullabilityCheckType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Nullability.NullabilityCheckType
public static Nullability.NullabilityCheckType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CREATEback to summary
public static final Nullability.NullabilityCheckType CREATE
DELETEback to summary
public static final Nullability.NullabilityCheckType DELETE
UPDATEback to summary
public static final Nullability.NullabilityCheckType UPDATE

Constructor Detail

NullabilityCheckTypeback to summary
private NullabilityCheckType()

Method Detail

valueOfback to summary
public static Nullability.NullabilityCheckType valueOf(String name)
valuesback to summary
public static Nullability.NullabilityCheckType[] values()