![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Session beans may be configured using dependency injection annotation.
Marks the class as an entity bean. Each entity bean corresponds to a database row. Entity bean persistence is configured with the CMP annotations. In EJB 3.0, the application uses entity bean instances directly. Unlike EJB 2.1, there is no pooling, local stub, or home interface for an entity. name | The bean's name | The bean's class name
| entityType | container-managed (CMP) or bean-managed (BMP) | CMP
| access | field-based (FIELD) or method-getter based (PROPERTY) | PROPERTY
| version | EJB version | 3
|
Defines the transaction boundary for session business methods. The default value is REQUIRED. If @TransactionAttribute annotates the class, it defines the default value. TransactionAttribute | meaning
| REQUIRED | Start a new transaction if necessary
| SUPPORTS | Don't start a new transaction, but use one if it
exists
| MANDATORY | Require the caller to have started a transaction
| NEVER | Forbid the caller to have started a transaction
| REQUIRESNEW | Always start a new transaction, suspending the
old one
| NOTSUPPORTED | Suspend any active transaction
|
Configures an EJB values for a field or method. @EJB is essentially a @Resource where it's known that the result is an EJB interface. jndiName | The jndi name of the resource | The field name
| In the following exaple, Resin will call Configures a JNDI values for a field or method. Inject relies heavily on defaults from the field or method name
and type. If more information is required, use @Resource, @EJB, or @EJBHome.
In the following exaple, Resin will call Configures a JNDI values for a field or method. @Resource is essentially the same as @Inject but provides more configurable options. @Resource can also be used at the Class level to declare a dependency in cases where the session bean loads the JNDI value by itself. name | The name of the resource | The field name
| resourceType | The resource typed | The field type
| authenticationType | Whether the container or the application is responsible for authentication | CONTAINER
| shareable | True if the bean follows JCA shareability requirements. | true
| jndiName | The jndi name of the resource | The field name
| In the following exaple, Resin will call javax.sql.DataSource | java:comp/env/jdbc
| javax.mail.* | java:comp/env/mail
| javax.ejb.EntityManager | java:comp/EntityManager
| javax.transaction.UserTransaction | java:comp/UserTransaction
| javax.ejb.EJBHome | java:comp/env/ejb
| javax.jms.* | java:comp/env/jms
|
Copyright (c) 1998-2009 Caucho Technology, Inc. All rights reserved. caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc. |