mirror of https://github.com/apache/openjpa.git
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
This commit is contained in:
parent
32dad9975e
commit
2edfd4fa5c
|
@ -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
|
each mapping throughout this chapter, we also describe the defaults that apply
|
||||||
when the mapping is absent.
|
when the mapping is absent.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
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.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
<section id="jpa_overview_mapping_table">
|
<section id="jpa_overview_mapping_table">
|
||||||
<title>
|
<title>
|
||||||
Table
|
Table
|
||||||
|
|
|
@ -107,6 +107,15 @@ in the Reference Guide for details. There are currently no XML equivalents for
|
||||||
these extension annotations.
|
these extension annotations.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</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>
|
<mediaobject>
|
||||||
<imageobject>
|
<imageobject>
|
||||||
<!-- PNG image data, 553 x 580 (see README) -->
|
<!-- PNG image data, 553 x 580 (see README) -->
|
||||||
|
|
Loading…
Reference in New Issue