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

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

  </description>
</header>

<summary objsummary='localtoc'/>

<section title="See Also">

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

</section>

<section title="Methods">

<defun title="@Entity">

<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>The name of the bean<td>The class name (unqualified)
<tr><td>entityType<td>container-managed (CMP) or bean-managed (BMP).<td>CMP
<tr><td>access<td>FIELD or PROPERTY<td>PROPERTY
<tr><td>version<td>The EJB version<td>3
</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/> will have
a <var/getFoo/> and a <var/setFoo/> 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>

</defun>

</section>

</document>
