<document>
<header>
  <title>EntityManager</title>
  <version>Resin 3.0</version>

  <description>
  <p>Primary interface for managing entity beans.</p>

  </description>
</header>

<localtoc/>

<s1 title="See Also">

<ul>
<li>See <a href="tutorial/cmp-basic/index.xtp">Basic tutorial</a> for
a complete single-table example.
</li></ul>

</s1>

<s1 title="Methods">

<s2 title="@Entity" type="defun">

<p>Annotates the class as an entity bean.</p>

<p>See the <a href="tutorial/cmp-basic/index.xtp">basic property tutorial</a>
and the <a href="tutorial/cmp-basic-field/index.xtp">basic field tutorial</a>
for an introduction.</p>

<deftable-childtags>
<tr><td>name</td><td>The name of the bean</td><td>The class name (unqualified)
</td></tr><tr><td>entityType</td><td>container-managed (CMP) or bean-managed (BMP).</td><td>CMP
</td></tr><tr><td>access</td><td>FIELD or PROPERTY</td><td>PROPERTY
</td></tr><tr><td>version</td><td>The EJB version</td><td>3
</td></tr></deftable-childtags>

<p>An <var>access</var> type of PROPERTY uses bean-style setters and getters
to implement CMP, i.e. each field <var>Foo</var> will have
a <var>getFoo</var> and a <var>setFoo</var> method.  The
<a href="tutorial/cmp-basic/index.xtp">basic property tutorial</a> describes
this access type.</p>

<p>An <var>access</var> type of FIELD modifies the Java fields directly
to impement CMP like JDO.  The
<a href="tutorial/cmp-basic-field/index.xtp">basic field tutorial</a>
describes this access type.</p>

<def>
@Target(TYPE)
@Retention(RUNTIME)
public @interface Entity {
  String name() default "";

  EntityType entityType() default CMP;
  AccessType access() default PROPERTY;
  int version() default 3;
}
</def>

</s2>

</s1>

</document>