You are on page 1of 1

Bean Types

T T M M T T T T M @Stateless(name=) @Statefull(name=) @Init(String[] init = {}) @Remove(retainIfException=false) @MessageDriven(name=, ActivationConfigPropery[]={}) @Entity(name=, access=[PROPERTY,FIELD], entityType=[CMP,BMP], version=3) @Remote @Local @BusinessMethod T T M

Interceptors
@Interceptor(classname=) @Interceptors(String[] classnames) @AroundInvoke MF MF MF MF MF

Relations
@ManyToOne(targetEntity=, CascasdeType[] cascade={},fetch=[LAZY, EAGER], optional=true) @OneToOne(targetEntity=, CascasdeType[] cascade={},fetch=[LAZY, EAGER],optional=true, mappedBy=, usePKasFK=false) @OneToMany(targetEntity=, CascasdeType[] cascade={},fetch=[LAZY, EAGER], mappedBy=) @AssociationTable(table=@Table(specified=false), JoinColumn[] joinColumns={}, inverseJoinColumns()={}) @ManyToMany(targetEntity=, CascasdeType[] cascade={},fetch=[LAZY, EAGER], mappedBy=)

Ealier View Client


Ts Ts @RemoteHome(String homeinterfacename, String remoteinterfacename) @LocalHome(String localinterfacename, String localinterfacename)

Queries
TM PTM PTM @FlushMode(value=[COMMIT, AUTO, NEVER]) @NamedQuery(name=, queryString, resultType, ejbInterfaceType[LOCAL, REMOTE]) @NamedQuerys(NamedQuery[] value)

Transaction and Security


T TM TM TM TM M T P @TransactionManagement( value=[CONTAINER,BEAN]) @TransactionAttribute(value=[MANDATORY, REQUIRED, REQUIRES_NEW, SUPPORTS, NOT_SUPPORTED, NEVER]) @MethodPermissions(String[] roles) @SecurityRoles(String[] rolesAllowed={}, rolesReferences={}) @Unchecked @Exclude @RunAs(String rolaname) @SecurityRoles(String[] RoleNames={})

Inheritance
T @Inhertance(strategy=[SINLGE_TABLE, TABLE_PER_CLASS, JOINED], discriminatorType=[STRING, CHAR, INTEGER], AttributeOverride[] inheritedAttributes={}) @InheritanceJoinColumn(name=, referencedColumnNames=, columnDefinition=) @InheritanceJoinColumn( InheritanceJoinColumn[] columns) @DiscriminatorColumn(name=, nullable=false, columnDefinition=, length=10)

ResultSetMapping
TM @SqlResultSetMapping(String name, EntityResult [] entities={}, ColumnResult[] columns={}) @EntityResult(String name, FieldResult[] fields = {}) @FieldResult(String name, column) @ColumnResult(String name) T T T

Object-Relational-Mapping
T T T TMF @Table(name=, catalog=, schema=, UniqueConstraint{}={}, specified=true) @SecondaryTable(name=, catalog=, schema=, JoinColumn[] join={}, UniqueConstraint[] uniqueConstraints={}) @SecondaryTables(SecondaryTable[] value) @UniqueConstraint(primary=false, String[] columnNames) @Column(name=, primaryKey=false, unique=false, nullable=true, insertable=true, updatable=true, columnDefinition=, secondaryTable=, length=255, precision=0, scale=0, specified=true) @JoinColumn(name=, referencedColumn=, primaryKey=, unique=false, nullable=true, insertable=true, updatable=true, columnDefinition=, secondaryTable=) @JoinColumns(JoinColumn[]) @Id(generate=[NONE, TABLE, SEQUENCE, IDENTITY, AUTO), generator=) @EmbeddedId(AttributeOverride[]={}) @AttributeOverride(name, Column[]={}) @IdClass @Transient @Version @Lob(fetch=[LAZY, EAGER], type=[BLOB,CLOB]) @Serialized(fetch=[LAZY, EAGER])

Callbacks
T M M M M Te Me Me Me Me Me Me @CallBackListener(String classname) @PostConstruct @PreDestroy @PostActivate @PrePassivate @EntityListener(String classname) @PrePersist @PostPersist @PreRemove @PostRemove @PreUpdate @PostLoad

Embedded Values
T MF @Embeddable(accessType=[PROPERTY,FIELD]) @Embedded(AttributeOverride[] override={})

Generators
PT PTMF PTMF @GenerateIdTable(name=, table=@Table(specified=false), pkColumnName=, valueColumnName=) @SequenceGenerator(String name, sequenceName=, initialValue=0, allocationSize=50) @TableGenerator(String name, tableName=, pkColumnValue=, allocationSize=50)

TMF

Resources
TMFP T TMFP T TMFP @Resource(name=, resourceType=, AuthenticationType=[CONTAINER,Application], shareable=true, jndiName=) @Resources(Resource[] value) @EJB(name=, businessInterface=, jndiName=) @EJBs{EJB[] value) @Home(name=, homeInterface=, String businessInterface, beanType= [SESSION, ENTITY], AccessMode=[LOCAL,REMOTE], jndiName= @Inject(jndiName=)

TMF MF MF T MF MF MF MF

Legend
PMTF Me Ts Annotation applies to Package, Method, Type, Field Annotation applies to Entity Bean Methods Annotation applies to Session Bean

VALUE Default Value

EJB 3.0 Annotations Cheat Sheet


2005 Philipp Meier www.fnogol.de Version 1.1 Based on EJB3.0 edr 2

MF

You might also like