Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
  Go To Table Of Contents
 Search
 PDFComments
Comments


id-validation

Use eclipselink.id-validation to define which primary key components values are considered invalid.


Values

Table 5-37 describes this persistence property's values.

Table 5-37 Valid Values for id-validation

Value Description

Negative

Null, 0 and negative values are invalid for IDs extending Number and primitive int and long IDs.

None

EclipseLink performs no ID validation.

Null

Null is invalid All other values are valid.

Zero

Null, 0 and negative values are invalid for primitive int and long IDs.



Usage

Identity and sequencing (with shouldAlwaysOverrideExistingValue configured as true) will override any existing ID value.


Examples

Example 5-27 Using id-validation in persistence.xml

<property name="eclipselink.id-validation" value="NULL"/> 


See Also

For more information, see: