Analysis results

Objects

Java

Icon Image ID Description Concept
icon JV_APPLET Applet Class
icon JV_CLASS Java Class Class
icon JV_GENERIC_CLASS Generic Java Class Class
icon JV_GENERIC_INTERFACE Generic Java Interface Class
icon JV_INST_CLASS Java Instantiated Class Class
icon JV_INST_INTERFACE Java Instantiated Interface Class
icon JV_INTERFACE Java Interface Class
icon JV_CTOR Java Constructor Class Constructor
icon JV_GENERIC_CTOR Generic Java Constructor Class Constructor
icon JV_INST_CTOR Java Instantiated Constructor Class Constructor
icon JV_EJB_ENTITY Entity Java Bean Data Entity
icon JV_EJB_SESSION Session Java Bean Data Object
icon JV_JDO Java Data Object Data Object
icon JV_RECORD Java Record Data Object
icon JV_RECORD_COMPONENT Java Record Component Data Object
icon JV_ENUM Java Enum Enumeration
icon JV_ENUM_ITEM Java Enum Item Enumeration
icon JV_FILE Java File File
icon JV_GENERIC_METHOD Generic Java Method Function
icon CAST_Java_Lambda Java Lambda Expression Function
icon JV_INIT Java Initializer Function
icon JV_INST_METHOD Java Instantiated Method Function
icon JV_METHOD Java Method Function
icon JV_PACKAGE Java Package Package
icon JV_IMPORT Java Import Project
icon JV_EJB_MESSAGE Message Driven Java Bean Service Interface
icon JV_FIELD Java Field Variable
icon JV_TYPEPARAM Generic Java Type Parameter Variable
icon CAST_Java_AnnotationType Java Annotation Type
icon CAST_Java_AnnotationTypeMethod Java Annotation Type Method Function
icon CAST_JAVA_AnonymousMethod Method of Anonymous Class Function

JSF (Java Server Face)

Icon Image ID Description Concept
icon JSF_MANAGED_BEAN JSF Managed Bean Bean
icon JSF_FACES_CONFIG_FILE JSF Faces Config File Configuration
icon JSF_CONVERTER JSF Converter Function
icon JSF_OUTCOME JSF Outcome Function
icon JSF_VALIDATOR JSF Validator Function
icon JSF_INPUT_FIELD JSF Input Field UI
icon JSF_VIEW_ID_PATTERN JSF View Id Pattern UI

JSP (Java Server Page)

Icon Image ID Description Concept
icon JSP_PROPERTY_MAPPING Java Property Mapping
icon JSP_SERVLET Servlet
icon JSP_SERVLET_MAPPING Servlet Mapping
icon JSP_STXX_PIPELINE STXX Pipeline
icon JSP_TAG JSP Custom Tag
icon JSP_TAG_ATTR JSP Custom Tag Attribute
icon JSP_TAG_LIB JSP Custom Tag Library
icon JSP_BEAN J2EE Scoped Bean Bean
icon JSP_BEAN_TILES_DEF Tiles Definition Bean
icon JSP_ACTION_MAPPING Struts Action Mapping Configuration
icon JSP_FORWARD Struts Forward Configuration
icon JSP_GENERIC J2EE XML Object Configuration
icon JSP_STXX_TRANSFORMS_FILE STXX Transforms File Configuration
icon CAST_HTML5_JSP_Content JSP Content File
icon JSP_PROPERTIES_FILE Java Properties File File
icon JSP_TILES_DEF_FILE Tiles Configuration File File
icon JSP_XMLCONFIG_FILE J2EE XML File File
icon JSP_APPDESCRIPTOR J2EE Web Application Descriptor Function
icon JSP_ELFUNCTION JSP EL Function Function
icon JSP_STXX_TRANSFORM STXX Transform Service Invocation
icon JSP_ATTRIBUTES_SCOPE Servlet Attributes Scope Variable
icon JSP_BEAN_PROP Bean Property Variable
icon JSP_BEAN_PROP_TILES_DEF_ATTRIBUTE Tiles Definition Attribute Variable

JEE Servlet

Icon Image ID Description Concept
icon JSP_SERVLET Servlet
icon JSP_SERVLET_MAPPING Servlet Mapping
icon CAST_Servlet_AnyOperation Servlet Any Operation Exposed Web Services
icon CAST_Servlet_DeleteOperation Servlet Delete Operation Exposed Web Services
icon CAST_Servlet_GetOperation Servlet Get Operation Exposed Web Services
icon CAST_Servlet_PostOperation Servlet Post Operation Exposed Web Services
icon CAST_Servlet_PutOperation Servlet Put Operation Exposed Web Services
icon CAST_HTML5_JEE_Servlet_Mapping_Access JEE Servlet Mapping Call Service Interface

Struts

Icon Image ID Description Concept
icon STRUTS_FORM_BEAN Struts Form Bean Bean
icon CAST_JEE_Struts2_ConfigurationFile Struts2 Configuration File Configuration
icon CAST_JEE_StrutsAction Struts Action Configuration
icon CAST_JEE_StrutsFilter Struts Filter Configuration
icon CAST_JEE_StrutsInterceptor Struts Interceptor Configuration
icon CAST_JEE_StrutsInterceptorStack Struts Interceptor Stack Configuration
icon CAST_JEE_StrutsResult Struts Result Configuration
icon STRUTS_CONFIG_FILE Struts Configuration File Configuration
icon CAST_Struts_GetOperation Struts Get Operation Exposed Web Services
icon CAST_Struts_Operation Struts Operation Exposed Web Services
icon CAST_Struts_PostOperation Struts Post Operation Exposed Web Services
icon CAST_JEE_StrutsValidator Struts Validator Function
icon CAST_Struts_FormValidator Struts Validate Operation Function
icon CAST_Struts_ParamInterceptor Struts ParameterInterceptor Function
icon CAST_JEE_StrutsPackage Struts Package Package
icon CAST_HTML5_JEE_Struts_Action_Access JEE Struts Action Call Service Interface

JPA/Hibernate

Icon Image ID Description Concept
icon JPA_EMBEDDABLE JPA Embeddable
icon JPA_PERSISTENCE_UNIT JPA Persistence Unit
icon JPA_SQL_RESULT_SET JPA Result Set
icon JPA_ORM_CONFIG_FILE JPA ORM Configuration File Configuration
icon JPA_PERS_CONFIG_FILE JPA Persistence configuration File Configuration
icon CAST_Java_JPA_Entity JPA Entity Data Entity
icon CAST_Java_JPA_Entity_Operation JPA Entity Operation Data Entity
icon CAST_Java_Unknown_JPA_Entity JPA Unknown Entity Data Entity
icon CAST_Java_Unknown_JPA_Entity_Operation JPA Unknown Entity Operation Data Entity
icon JPA_ENTITY JPA Entity Data Entity
icon CAST_Java_JPA_JPQLQuery JPQL Query Data Query
icon CAST_Java_JPA_SQLQuery JPA SQL Query Data Query
icon CAST_Java_Unknown_JPA_SQLQuery JPA Unknown SQL Query Data Query
icon CAST_SpringData_JPA_SQLQuery Spring Data JPQL Query Data Query
icon JPA_NAMED_NATIVE_QUERY JPA Named Native Query Data Query
icon JPA_NAMED_QUERY JPA Named Query Data Query
icon JPA_EMBEDDABLE_PROPERTY JPA Embeddable Property Variable
icon JPA_ENTITY_PROPERTY JPA Entity Property Variable

Program Call

Icon Image ID Description Concept
icon CAST_Java2Program_GeneralCall Java Call to Generic Program Run Service
icon CAST_Java2Program_JarProgram Java JAR Program Run Service
icon CAST_Java2Program_JavaCall Java Call to Java Program Run Service

The following is a non-exhaustive list of links that may be identified between objects saved in the CAST Analysis Service:

References that are detected by the analyzer while analyzing JSP Pages and static references 

Click here to expand…

Link Type

When is this type of link created? Example
MENTION This link is created for the taglib directive.

The caller is the JSP File where the directive is defined.

The callee is the Tag Library identified by the "uri" attribute.

<%@ taglib uri="/examples-taglib" prefix="eg"%>
INCLUDE This link is created for the include directive.

The caller is the JSP File where the directive is defined.

The callee is a JSP File, Static File or a JSP Mapping as specified by the "file" attribute.

<%@ include file="URL"%>
INHERIT This link is used to describe object hierarchy. It is created for the page directive.

It is always enriched by the sub-type Extend (class to super-class).

The caller is the JSP File where the directive is defined.

The callee is a Java Class as specified by the "extends" attribute.

<%@ page extends="com.cast.SuperClass"%>
THROW This link is used to describe exception handling. It is created for the page directive.

The caller is the JSP File where the directive is defined.

The callee is a File (JSP or static) or a JSP Mapping as specified by the "errorPage" attribute.

<%@ page errorPage="URL"%>
ACCESS

This link is used to describe run-time interactions. It may be enriched by the following sub-types:

  • Read
  • Write
  • Forward
  • Include

In the "example" column you will find a list of all cases when these links are created. If omitted, the caller is the JSP File where the standard or custom action is defined.

Read
<jsp:getProperty name="clock" property="dayOfMonth"/>

The callee is the Bean Property as specified by the "property" attribute.

Write
<jsp:setProperty name="clock" property="dayOfMonth" value="13"/>

The callee is the Bean Property as specified by the "property"attribute.>

<eg:foo attr1="value"/>

The callee is the Tag Attribute as specified by the name of an attribute of the custom action.

Forward
<jsp:forward page="URL"/>

The callee is a File (JSP or static) or a JSP Mapping.

Definition of a servlet mapping: the caller is the Servlet Mapping and the callee is the associated Servlet.

Definition of a property mapping: the caller is the Property Mapping and the callee is a File (JSP or static), a JSP Mapping or a Java Type.

Include
<jsp:include page="file"/>

The callee is a File (JSP or static) or a JSP Mapping.

RELY ON This link is used to describe typing.

Caller uses callee to define its Java type. Callee always refers to a class or interface.

In our case the caller is a Bean and the callee is its class as specified by either "class" or "beanName" attribute.

Note that for all beans created from a XML Configuration file, a link of this type is automatically created.

<jsp:useBean id="clock" class="beans.clockBean" ... />
USE This link is created for the jsp:useBeanstandard action.

The caller is the JSP File where the action is defined.

The callee is a Bean as specified by the "id" attribute.

This type is also used for dynamic link resolution. It covers server side objects referencing.

<jsp:useBean id="clock" class="beans.clockBean" ... />
PROTOTYPE This link is used as follows:

Servlet: between the servlet component and its servlet class or JSP File as specified in the application descriptor via "servlet-class" or "jsp-file" XML element.

Custom Tag: between the tag object and its class or tei-class as specified in the tag library descriptor via "tag-class" and "tei-class" xml elements.


USER DEFINED These links are entirely specified by the user in the application's additional XML configuration files.

Users can use the following string values to specify the link type:

access (Access), call (Call), catch (Catch), fire (Fire), include (Include), inherit (Inherit), issonof (Is Son Of), lock (Lock ), mention (Mention), prototype (Prototype), raise (Raise), refer (Refer), relyon (Rely On), throw (Throw) or use (Use).

The following table shows a non exhaustive list of these types of links:


Caller Callee
XML Configuration File
  • Java Type (class or interface)
  • Java Method
  • JSP Mapping
  • File (JSP or static)

  • Bean

Action Mapping
  • Java Type (class or interface)
  • JSP Mapping
  • File (JSP or static)
  • Bean

ESCALATED When two objects are linked via a third object. Denoted by the square brackets around the link type in CAST Enlighten: [U]
INTERNAL ESCALATED Created when the calling object is not saved in the CAST Knowledge Base (i.e. a variable that is local to a function). As a result the analyzer will save the link and associate it with the parent of the calling object. Denoted by the curly brackets (or braces) around the link type in CAST Enlighten: {U}

References detected by the analyzer when carrying out a pure Java analysis

Click here to expand…

Link type When is this type of link created? Example
MENTION This link is traced on following expressions:

- "instance of" operator

- cast expression

- class literal

- this literal

- class creation

- array creation

Callee always refers to a class or interface.

- if (b instanceof A . class) ...

- A . this = 1;

- B b = (B) new A(1);

- B b [] = new A[5];

THROW, RAISE, CATCH These links are used to describe exception handling.
  • Throw link is traced on "throws" clause of method declaration towards exceptions possibly raised by the method.
  • Raise link is traced on "throw" statement towards type of the exception actually thrown by the method.
  • Catch link is traced on "try" statement towards type of the exception parameter declared in catch clause(s).

Callee always refers to a class.

- void f () throws C1 {...}

- throw new Exception()

- try {...}
catch (Throwable e) {...)

RELY ON This link is used to describe typing.

Caller uses callee to define its Java type.

Callee always refers to a class or interface.

- void f (A a) {...}

- A a [] = null;

ACCESS This link is used to describe run-time interactions.

It may be enriched by the following sub-types:

- Read

- Write

- Exec

- Member

- Array

- return x

- x = 1

- x++

- x[1] = 2

- x[] = {1,2}

- f(1)

- x.toString()

- x.f()

- x.y = 1

- read

- write

- read and write

- array not read

- read

- exec

- member

- member on x ; exec on f

- member on x ;write on y

INHERIT This link is used to describe object hierarchy. It may be enriched by the following sub-types:

- Extend:

  • class to super-class
  • interface to super-interface

- Implement:

  • class to super-interface(s)

Caller and callee always refer to classes or interfaces.

By extension the Inherit link is also used to describe method overriding as directly related to inheritance. In this case exclusive sub-types are available:

- Hide: for static methods;

- Override: for instance methods; in addition link can be enriched by the Implement sub-type if overriding is from a non abstract overriding method to an abstract overridden one.

Caller and callee always refer to methods.

- class C1 extends C2 implements I
{...}

- interface I1 extends implements I2
{...}

USE This type is reserved for dynamic link resolution. It covers server side objects referencing:

- Select

- Insert

- Update

- Delete

-
PROTOTYPE This link is reserved for J2EE components' support and is used as follows:
  • Applet: between the applet component and its applet class.

Caller and callee always refer to a component and to a class or interface.

-
  • “Exec access” links can be thought of as invocation calls.
  • To avoid redundancy with a corresponding escalated link, a “member access” link is not traced on a qualifier if this one matches the member parent.
  • “Prototype” links are never escalated.

References that are detected by the analyzer while analyzing JSP pages and Tag Files as client files

Click here to expand…

Link Type When is this type of link created?
USE TypLib
<!--METADATA TYPE = "TypeLib" FILE = "TypLibFileName" -->
Applet
<APPLET CODE = "AppletCode" CODEBASE = "AppletCodeBase" >
ActiveX through a variable
x = new ActiveXObject("A.B")
function f()
{
x.Method()

Use link between f and A.B

Dynamic data source
<OBJECT id = id_obj classid = "clsid:Sample"></OBJECT>
<A DATASRC=#id_obj datafld = "url" id=id_a>

Use link between id_a and id_obj

Database object


<SCRIPT>
ExecuteSQL("select * from authors")
</SCRIPT>
MAP
<img src="images/cover.jpg" border=0 usemap="#covermap" ismap id=id_img>
<map name="covermap">
<area shape=rect href="whatis.htm" coords="0,0,315,198">
<area shape=rect href="signup.asp" coords="0,198,230,296">
<area shape=rect href="holdings.asp" coords="229,195,449,296">
<area shape=rect href="question.htm" coords="314,0,449,196">
</map>
MENTION Indicates the area in which the ActiveX is mentioned
function f()
{
return CreateObject("A.B")
}

Mention link between f and A.B

Indicates the area in which the class name is mentioned
function f()
{
return new g()
}

Mention link between f and g

INCLUDE Indicates the inclusion of a file
<SCRIPT LANGUAGE = "JavaScript" SRC = "inc.js">
</SCRIPT>
CALL Indicates a call to a file
<A HREF = "called_file.htm" ></A>
<SCRIPT LANGUAGE = JavaScript>
window.open("called_file.htm")
</SCRIPT>
Indicates a function call
<SCRIPT>
function f()
{
return 1;
}
function g()
{
return f()
}
</SCRIPT>

Call link between g and f

ACCESS Indicates a access type link enters a property of an HTC component together with the associated PUT or GET function.
<PUBLIC:PROPERTY NAME="xmlData"
 ID="xmlDataID" 
GET="getxmlData" PUT="putxmlData"/>

ACCESS link between xmlData and the getxmlData and putxmlData functions.

ACCESS and
READ
Read only access to a file
<!--#FLASTMODE FILE = "accessed_file.htm">
Read only access to a variable
<SCRIPT>
function f()
{
y=x
}
</SCRIPT>

Read only access between f and x

ACCESS and
WRITE
Read and write access to a variable
<SCRIPT>
function f()
{
y=x
}
</SCRIPT>

Read and write access between f and y

ACCESS and PAGE_FORWARD Indicates a redirection. Only available for analyzed IIS applications. -
REFER Indicates that a variable refers to another variable
<SCRIPT>
x = new ActiveXObject("A.B")
Application("y")=x
</SCRIPT>

Refer link between Application("y") and x

RELY ON and INSTANCE OF Indicates that a variable is an instance of a class
<SCRIPT>
x=new ActiveXObject("A.B")
</SCRIPT>

INSTANCE_OF link between x and A.B

GO THROUGH Indicates the error file(s) used. Only available for analyzed IIS applications. -

References that are detected by the analyzer while analyzing the JSP page implementation class and/or Tag Handlers are dynamic references

Click here to expand…

For the dynamic references which are issued from a grep or have the caller located in a JSP script element as a declaration, expression or scriplet, a static link will be created. This new link has almost the same properties as the dynamic link, however the caller can be different. For example, when an object is located in an included file we will have a dynamic reference from the _jspService function of the JSP Page (resp. doTag method of a Tag File) and the object and a static reference from the included JSP File (resp. Tag File) and the object.

Note that the main function of the generated servlet/handler class is a pure dynamic object. So, it cannot have static references and we will create them at the function’s parent (JSP Page/Tag File) level.

The following table summarizes the process of creation of the static links using the dynamic links while parsing generated servlet classes (‘Dynamic Caller’ are replace by ‘Static caller’):

Caller: Dynamic Object Link code located in Caller: Static Object
_jspService JSP page JSP page
_jspService JSP page JSP page
servlet class JSP page JSP page
servlet class JSP File (included file) JSP File (included file)
caller JSP Page or JSP File (included file) JSP Page or JSP File (included file)
Code sample

file a.jsp

<%! String redirectA; %>
<% redirectA = "/jsp/fileA.jsp"; %>

file a.jsp

<%@ include file="included.jsp"%>

file included.jsp

<%! String includedA; %>
<% includedA = "/jsp/fileA.jsp"; %>

Click here to expand…

The following lists describes references that are detected by the JEE analyzer and the context in which corresponding links are traced and stored in the CAST Analysis Service:

Links between bean and class/interfaces are flagged as “Prototype” and are oriented as follows:

  • From bean local and remote interfaces to the EJB itself,
  • From the EJB itself to its bean class and, for entity bean, primary key class.

In addition the following links are also traced:

Link Type When is this type of link created?
FIRE

1. Traced between bean class member methods that are implicitly called by the EJB Container:

Home interface
Bean class
Remote interface
create(...) --F--> ejbCreate(...) <--F-- create(...)
remove(...) --F--> ejbRemove(...) <--F-- remove(...)


< implemented business methods > <--F-- < exported business methods >
find<method>(...) --F--> ejbFind<method>(...)

2. Traced between bean class/home interface and server side objects. For example in this standard ejb-jar.xml file:

<entity>
   <ejb-name>CustomerBean</ejb-name>
   ...
   <abstract-schema-name>Customer</abstract-schema-name>
   ...
   <query>
      <query-method>
         <method-name >findByFirstName</method-name>
         <method-params>
            <method-param>java.lang.String</method-param>
         </method-params>
      </query-method>
      <ejb-ql>SELECT DISTINCT OBJECT(c) FROM Customer AS c WHERE c.firstName = ?1</ejb-ql>
   </query>
</entity>

The signature of the method is created from the values of the tags <method-name> and <method-param>. The method is searched for using the home interfaces (for the findXXX) and the bean class (for the "select methods").

The abstract schema name identified by grep in the query "EJB-QL" is used to find the associated bean (the query can reference the abstract schema name of another bean). From the bean it is possible to retrieve the associated table names and then link resolution is possible.

3. Also traced between SEI.Mi (Service Endpoint Interface) and BC.Mi (Bean Class). Mi stands for methods that have the same signature in the SEI and the BC. The EJB must be a stateless session bean:

  • SEI.Mi -- Fire --> BC.Mi

4. In addition, this link type is used for implicit invocations. They are used to reflect:

  • either the life cycle events of a component (such as creation/destruction)
  • or the interaction of an external actor such as a container (for EJBs or servlets) or a web browser (for applets)

Caller always refers to a component or a class member method. Callee always refers to a class member method.

Note: "Fire" links are never escalated.
USE SELECT
Traced between bean and server objects (tables).
  • Bean --Usdui--> Table (U for Use, s for Select, d for Delete, u for Update, i for Insert)
  • Finder and select Method --Us--> Table

The link Bean --Usdui--> Table is traced only with container managed persistence (cmp) beans. For Bean managed persistence (bmp) beans, this link is indirect and is represented by two links:

  • One from Bean component to its java class (traced by EJB Assistant ).
  • One from Methods of the bean class where access to database objects is coded (via jdbc) to server objects corresponding to these objects (tables in this case). This link is traced by Java Analyzer.

For example in this standard ejb-jar.xml file:

<entity id="ContainerManagedEntity_1">
   <ejb-name>PlayerEJB</ejb-name>
   ...
   <abstract-schema-name>Player</abstract-schema-name>
   ...

The bean in question is found in the ejb-jar.xml file using its name. Persistence information is identified using descriptors specific to each server type:

DELETE
UPDATE
INSERT
PROTOTYPE
This link type is reserved for J2EE components' support and is used as follows:
  • EJB: between the bean component and its implementation classes (bean class, local/remote interfaces and possibly primary key class).
  • Servlet: between the servlet component and its servlet class.
  • EJB: between the bean and the SEI (Service Endpoint Interface).

For example the Webservices.xml (must be placed in the module directory)

<webservices ...>
   <webservice-description>
      ...
      <webservice-description-name>MyHelloService</webservice-description-name>
      <jaxrpc-mapping-file>mapping.xml</jaxrpc-mapping-file> // relatif ou absolu
      <port-component>
      ...
         <port-component-name>HelloIF</port-component-name>
         <service-endpoint-interface>helloservice.HelloIF</service-endpoint-interface>
         <service-impl-bean>
            <ejb-link>HelloServiceEJB</ejb-link>
         </service-impl-bean>
      </port-component>
   </webservice-description>
</webservices>

JAX-RPC mapping file (mapping.xml in the example) indicates that the mapping information between the web service operation and the java methods can be found in mapping.xml.

<java-wsdl-mapping ...>
...
      <port-mapping>
         <port-name>HelloIFPort</port-name>
      </port-mapping>
   </service-interface-mapping>
   <service-endpoint-interface-mapping>
      <service-endpoint-interface>helloservice.HelloIF</service-endpoint-interface>
      <service-endpoint-method-mapping>
         <java-method-name>sayHello</java-method-name>
         <wsdl-operation>sayHello</wsdl-operation>
            <method-param-parts-mapping>
               <param-position>0</param-position>
               <param-type>java.lang.String</param-type>
               ...
               </method-param-parts-mapping>
   </service-endpoint-method-mapping>
   </service-endpoint-interface-mapping>
</java-wsdl-mapping>

Link example:

Note: "Prototype" links are never escalated.
ACCESS
These links correspond to inter-bean references. These references are made via a logical name (declared in the ejb-jar.xml file and that specifies the target ejb) used in the bean client code. The tags containing this logical name are <ejb-ref> or <ejb-local-ref>.
  • EJB client -- Access --> EJB target

For example in this standard ejb-jar.xml file:

<entity> //ou session ou message-driven
   <ejb-name> AddressBean</ejb-name>
   <ejb-ref> //ou ejb-local-ref
      <ejb-ref-name>ejb/CustomerRef</ejb-ref-name>
      ...
      <ejb-link>CustomerBean</ejb-link>
   </ejb-ref>
</entity>

Each bean specifies the list of other beans it accesses as well as the references used to do so.

JOIN
Traced between entity beans based on the abstract schema defined in deployment descriptor (beneath the <relationships>...</relationships> tag).

An entity bean (source EJB) is linked to another entity bean (destination EJB) only if navigation is possible from source EJB to destination EJB, i.e the relation-role in which source EJB is involved contains at least one cmr (container managed relationship) field allowing access to the destination EJB.

<ejb-relation>
  <description>Team To Player</description>
  <ejb-relation-name>PlayerEJB.teams-TeamEJB.players</ejb-relation-name>
  <ejb-relationship-role>
     <ejb-relationship-role-name>TeamEJB</ejb-relationship-role-name>
     <multiplicity>many</multiplicity>
     <relationship-role-source>
         <ejb-name>TeamEJB</ejb-name>
     </relationship-role-source>
     <cmr-field>
        <cmr-field-name>players</cmr-field-name>
        <cmr-field-type>java.util.Collection</cmr-field-type>
     </cmr-field>
  </ejb-relationship-role>
 
  <ejb-relationship-role>
     <ejb-relationship-role-name>PlayerEJB</ejb-relationship-role-name>
     <multiplicity>many</multiplicity>
     <relationship-role-source>
        <ejb-name>PlayerEJB</ejb-name>
     </relationship-role-source>
     <cmr-field>
        <cmr-field-name>teams</cmr-field-name>
        <cmr-field-type>java.util.Collection</cmr-field-type>
     </cmr-field>
  </ejb-relationship-role>
</ejb-relation>

Considering the example above, the source EJB TeamEJB will be linked to the destination EJB PlayerEJB because the cmr field players makes navigation possible from source to destination EJB.

For the same reasons, PlayerEJB (now source EJB) will have Refer link to TeamEJB (destination EJB for this link).

For each Join link, the information below is retrieved from the deployment descriptor and accessible in HTML Report:

  • Relation Name

    The name of the EJB relation as found in the <ejb-relation-name> tag of the deployment descriptor (PlayerEJB.teams-TeamEJB.players in the example). If no name is provided, EJB Assistant computes a name for the relation, based on the names of the two beans involved. For instance, the computed name would be TeamEJB-PlayerEJB if PlayerEJB.teams-TeamEJB.players was missing in the example.

  • Relation Description

    The relation description as specified in the descriptor. No default value for this attribute.

  • Multiplicity

    One of the string Many, One or N/S if relation role multiplicity is not specified in the descriptor.

How are references traced?

The names of underlying tables for each entity bean are retrieved from descriptors containing persistence information (that map beans to database tables or other devices). These names are then compared to the selected  server objects’ names. If the names match each other then a link is created  between the entity bean and the server objects (tables).

For bean class and/or interface methods, links with server objects are traced based on a string search of the entity bean’s Abstract schema name from the method’s EJB-QL statement in the ejb-jar.xml file. Once the abstract schema name is found, the methods are then linked to the underlying tables of the entity bean.

The examples below give an overview of the mapping process:

  • Common file (ejb-jar.xml)
 <entity id="ContainerManagedEntity_1">>
       <ejb-name>PlayerEJB</ejb-name>
    ...
       <abstract-schema-name>Player</abstract-schema-name>
    ...
    ...
       <query>
         <query-method>
           <method-name>ejbSelectLeagues</method-name>
           <method-params>
             <method-param>team.LocalPlayer</method-param>
           </method-params>
         </query-method>
         <ejb-ql> select distinct t.league from Player p, in (p.teams) as t where p = ?1 </ejb-ql>
       </query>
    ...
  • Weblogic application server (weblogic-cmp20-rdbms-jar.xml)
 <weblogic-rdbms-bean>
     <ejb-name>PlayerEJB</ejb-name>
    ...
     <table-map>
       <table-name>localplayers</table-name>
       <field-map>
         <cmp-field>name</cmp-field>
         <dbms-column>name</dbms-column>
       </field-map>
    ...
    ...
  • Borland enterprise server (ejb-borland.xml)
<ejb-jar>
     <enterprise-beans>
         <entity>
             <ejb-name>PlayerEJB</ejb-name>
             <bean-home-name>PlayerEJBRemote</bean-home-name>
             <cmp2-info>
                 <cmp-field>
                     <field-name>playerId</field-name>
                 </cmp-field>
        ...
                 <table-name>localplayers</table-name>
             </cmp2-info>
         </entity>
     </enterprise-beans>
    ...
    ...
  • Websphere application server (Map.mapxmi)
<ejbrdbmapping:EjbRdbDocumentRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
 xmlns:ejbrdbmapping="ejbrdbmapping.xmi" xmlns:Mapping="Mapping.xmi" xmlns:ejb="ejb.xmi"
 xmlns:RDBSchema="RDBSchema.xmi" xmlns:java="java.xmi" xmi:id="EjbRdbDocumentRoot_1"
 outputReadOnly="false" topToBottom="true">
    ...
   <nested xsi:type="ejbrdbmapping:RDBEjbMapper" xmi:id="RDBEjbMapper_1">
    ...
     <inputs xsi:type="ejb:ContainerManagedEntity" href="META-INF/ejb-jar.xml#ContainerManagedEntity_1"/>
     <outputs xsi:type="RDBSchema:RDBTable" href="META-INF/Schema/Schema.dbxmi#Player"/>
  • Websphere application server (Schema.dbxmi)
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:RDBSchema="RDBSchema.xmi">
    ...
   <RDBSchema:RDBTable xmi:id="Player" name="localplayers" primaryKey="playerId" database="MyDB_ID">
     <namedGroup xsi:type="RDBSchema:SQLReference" xmi:id="SQLReference_1" members="RDBColumn_1"
     table="Player" constraint="Constraint_HistoryPK"/>

In the ejb-jar.xml file of the above Webspheres example, there is an entity bean, PlayerEJB, whose abstract schema name is Player that has a method called ejbSelectLeagues. This method references the abstract schema name (Player) of PlayerEJB in its EJB-QL statement.

Every server specific deployment descriptor (listed above) maps PlayerEJB to the table localplayers. For websphere format: In ejb-jar.xml, PlayerEJB is given the Id ContainerManagedEntity_1. The Map.mpaxmi file maps ContainerManagedEntity_1 to the Id Player and this Id is mapped in Schema.dbxmi to the table localPlayers.

From this information, the following links are created:

  • PlayerEJB ==> localplayers (the server object has a name matching the string “localplayers”. If none, no link will be created).
  • ejbSelectLeagues ==> localplayers (this is done via PlayerEJB and its abstract schema name).

Example below shows how the mapping (bean-table) process is carried out when a Weblogic Application server delegates persistence management to TopLink:

  • weblogic-ejb-jar.xml
 <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
        <ejb-name>Employee</ejb-name>
        <entity-descriptor>
            <persistence>
                <persistence-use>
                    <type-identifier>TopLink_CMP_2_0</type-identifier>
                    <type-version>4.5</type-version>
                    <type-storage>META-INF/toplink-ejb-jar.xml</type-storage>
                </persistence-use>
            </persistence>
        </entity-descriptor>
        ...
    </weblogic-enterprise-bean>
    ...
 </weblogic-ejb-jar>
  • META-INF/toplink-ejb-jar.xml (referenced above)
<toplink-ejb-jar>
   <session>
       <name>ejb20_EmployeeDemo</name>
       <project-xml>Employee.xml</project-xml>
       ...
   </session>
 </toplink-ejb-jar>
  • Employee.xml (referenced in META-INF/toplink-ejb-jar.xml)
<project>
    <project-name>Employee</project-name>
    ...
    <descriptors>
        <descriptor>
            <java-class>examples.ejb.cmp20.advanced.EmployeeBean</java-class>
            <tables>
                <table>Employee</table>
            </tables>
            ...
        </descriptor>
    </descriptors>
</project>
  • For the <type-identifier> tag in weblogic-ejb-jar.xml file, only identifiers TopLink_CMP and  WebLogic_CMP_RDBMS are recognized.
  • From toplink-ejb-jar.xml file, <session> tags are scanned until we meet the project file (considering bean class fully qualified name) that provide persistent information for the given bean (Employee in the example above) .
  • If the project file path(Employee.xml) is not a full path, then it is supposed to be relative to the module directory (in general, this directory corresponds to the one containing the META-INF folder).
  • Only references to server objects that have been previously registered in the Analysis Service can be traced. When a reference to an unregistered object is detected, CAST will first try to register the object. If it fails, a warning message is issued and the reference will not be saved.