Top Description Fields Constructors Methods
org.hibernate.engine

public final Class Nullability

extends Object
Class Inheritance
Imports
java.util.Iterator, org.hibernate.HibernateException, .PropertyValueException, org.hibernate.intercept.LazyPropertyInitializer, org.hibernate.persister.entity.EntityPersister, org.hibernate.type.CollectionType, .CompositeType, .Type

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

Field Summary

Modifier and TypeField and Description
private final boolean
private final SessionImplementor

Constructor Summary

AccessConstructor and Description
public

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
(final Object
component properties
value
,
final CompositeType
component not-nullable type
compType
)

check component nullability.

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

Check nullability of the class persister properties

private String

Returns:

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

check sub elements-nullability.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

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

Constructor Detail

Nullabilityback to summary
public Nullability(SessionImplementor 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(final Object value, final CompositeType compType) throws HibernateException

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

Parameters
value:Object

component properties

compType: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) throws PropertyValueException, HibernateException

Check nullability of the class persister properties

Parameters
values:Object[]

entity properties

persister:EntityPersister

class persister

isUpdate:boolean

wether it is intended to be updated or saved

Exceptions
PropertyValueException:
Break the nullability of one property
HibernateException:
error while getting Component values
checkSubElementsNullabilityback to summary
private String checkSubElementsNullability(final Type propertyType, final 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