blob: df33cb21693a4183df22751d07228e088cb7e71a [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2011" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Creating a EJB 3.1 session bean using the wizard" />
<meta name="abstract" content="You can use the Create Session Bean wizard to create a session bean in your EJB project." />
<meta name="description" content="You can use the Create Session Bean wizard to create a session bean in your EJB project." />
<meta content="EJB 3.0, session bean, creating, Session bean" name="DC.subject" />
<meta content="EJB 3.0, session bean, creating, Session bean" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/tecrtpro.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="tsessbeanwiz" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Creating a EJB 3.1 session bean using the wizard</title>
</head>
<body id="tsessbeanwiz"><a name="tsessbeanwiz"><!-- --></a>
<h1 class="topictitle1">Creating a EJB 3.1 session bean using the wizard</h1>
<div><p>You can use the <span class="uicontrol">Create Session Bean</span> wizard
to create a session bean in your EJB project.</p>
<div class="section">Here are the steps to create a session bean in an EJB project:</div>
<ol>
<li class="stepexpand"><span>In the Java™ EE perspective, right-click
your EJB Project, and select <span class="menucascade"><span class="uicontrol">File</span>
&gt; <span class="uicontrol">New</span> &gt; <span class="uicontrol">Session Bean</span>
</span>. The Create Session Bean wizard appears.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Project</span> field, ensure that
your EJB Project name appears.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Folder</span> field, select the
source folder for the new bean.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Java package</span> field, type
the package name for the new bean.</span></li>
<li class="stepexpand"><span>In the <strong>Class name</strong> field, type the name that you
want to assign to the session bean. By convention, bean names should
begin with an uppercase letter.</span> <div class="note"><span class="notetitle">Note:</span> You can use Unicode
characters for the bean name, but Unicode characters are not supported
for enterprise bean packages and classes associated with enterprise
beans.</div>
</li>
<li class="stepexpand"><span>In the <strong>Superclass</strong> field, <span class="uicontrol">Browse</span> to
find a Superclass to add to your Session bean.</span></li>
<li class="stepexpand"><span>In the <strong>State Type</strong> field, select the type of Session
bean you want to create. Valid options are</span> <ul>
<li>Stateless</li>
<li>Stateful</li>
</ul>
</li>
<li class="stepexpand"><span><em>Optional</em>In the <span class="uicontrol">Create Business Interface</span> field,
select <span class="uicontrol">Local</span> or <span class="uicontrol">Remote</span> if
you want to include these interfaces.</span></li>
<li class="stepexpand"><span>Click <span class="uicontrol">Next</span>.</span></li>
<li class="stepexpand"><span>On the Session Bean information page, you may change the
values of some of the Session bean elements: </span> <ul>
<li><em>Optional</em>: In the <span class="uicontrol">EJB Name</span> field,
you can change the value of your EJB name that you assigned in the
previous page.</li>
<li><em>Optional</em>: In the <span class="uicontrol">Mapped Name</span> field,
type a value for your EJB Mappedname.</li>
<li><em>Optional</em>: In the <span class="uicontrol">Transaction Type</span> field,
select the type of Session bean you want to create (Container or Bean).</li>
<li><em>Optional</em>: In the <span class="uicontrol">Business Interfaces</span> field,
you can add or remove Business Interfaces that you created in the
previous wizard page.</li>
</ul>
</li>
<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span></li>
<li class="stepexpand"><span>In the Java class editor, your new Session
bean appears, with the @Stateless annotation and the required import
statements.</span> </li>
</ol>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/tecrtpro.html" title="An EJB project is used to organize the resources contained in an EJB module.">Creating EJB projects</a></div>
</div>
</div>
</body>
</html>