Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3)
B14428-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Configuring a Lifecycle Callback Method for an EJB 3.0 Entity

You can specify an EJB 3.0 entity class method as a callback method for any of the following lifecycle events:

The entity class method must have the following signature:

public int <MethodName>()

For more information, see:

Using Annotations

You can specify an EJB 3.0 entity class method as a lifecycle callback method using any of the following annotations:

  • @PrePersist

  • @PostPersist

  • @PreRemove

  • @PostRemove

  • @PreUpdate

  • @PostUpdate

  • @PostLoad

Example 7-25 shows how to use the @PrePersist annotation to specify EJB 3.0 entity class method initialize as a lifecycle callback method.

Example 7-25 @PrePersist

@PrePersist
public int initialize()
{
  ...
}