From 2edfd4fa5c30e8e9b3f42717836e128f1ce7cb07 Mon Sep 17 00:00:00 2001 From: Michael Dick Date: Thu, 29 Apr 2010 18:54:58 +0000 Subject: [PATCH] Update manual on difference between nullable=false and optional=false git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.0.x@939452 13f79535-47bb-0310-9956-ffa450edef68 --- openjpa-project/src/doc/manual/jpa_overview_mapping.xml | 8 ++++++++ openjpa-project/src/doc/manual/jpa_overview_meta.xml | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/openjpa-project/src/doc/manual/jpa_overview_mapping.xml b/openjpa-project/src/doc/manual/jpa_overview_mapping.xml index ce66feeb7..b59dee2e5 100644 --- a/openjpa-project/src/doc/manual/jpa_overview_mapping.xml +++ b/openjpa-project/src/doc/manual/jpa_overview_mapping.xml @@ -99,6 +99,14 @@ JPA uses the defaults defined by the specification. As we present each mapping throughout this chapter, we also describe the defaults that apply when the mapping is absent. + + +Mapping metadata is used primarily with schema generation. This metadata should not +be relied upon for validation prior to communicating with the database. +For example using the @Column(nullable=false) annotation does not do up front validation +that the value in the entity is correct. + +
Table diff --git a/openjpa-project/src/doc/manual/jpa_overview_meta.xml b/openjpa-project/src/doc/manual/jpa_overview_meta.xml index 163bfe1da..2eb60c803 100644 --- a/openjpa-project/src/doc/manual/jpa_overview_meta.xml +++ b/openjpa-project/src/doc/manual/jpa_overview_meta.xml @@ -107,6 +107,15 @@ in the Reference Guide for details. There are currently no XML equivalents for these extension annotations. </para> </note> + <note> + <para> +Persistence metadata may be used to validate the contents of your entities prior to communicating +with the database. This differs from mapping meta data which is primarily used for schema generation. +For example if you indicate that a relationship is not optional (e.g. @Basic(optional=false)) OpenJPA +will validate that the variable in your entity is not null <emphasis>before</emphasis> inserting a row +in the database. + </para> + </note> <mediaobject> <imageobject> <!-- PNG image data, 553 x 580 (see README) -->