WebSphere Application Server Network Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Using the Enterprise JavaBeans data mediator service for data access

Why and when to perform this task

The following steps use code samples to describe a simple instance of how to create the Enterprise JavaBeans data mediator service (DMS) metadata.

Steps for this task

  1. A mediator instance is created using one of the create methods on the mediator factory (com.ibm.websphere.sdo.mediator.ejb.MediatorFactory) as in the following example
    import com.ibm.websphere.sdo.mediator.ejb.Mediator;
    import com.ibm.websphere.sdo.mediator.ejb.MediatorFactory;
    import com.ibm.webpshere.ejbquery.QueryException;
    import commonj.sdo.DataObject;
    
    try{
     String[] query =  { "select d.deptno,d.name from DeptBean as d" }; 
     Mediator m = MediatorFactory.getInstance().createMediator( query, null);
     DataObject root = m.getGraph();
    } catch (QueryException e) { ... } 
  2. There are 3 different forms of the createMediator method. The arguments are explained below.
    createMediator( query, parms) 
    createMediator( query, parms, schema )
    createMediator( query, parms, schema,  typeMap,  pattern)

    The arguments to the createMediator method are:

    String query array of EJB query statements
    Object parms values for input parameters of the query statements
    Eclass* schema the EClass of the root DataObject
    Map* typeMap a java.util.Map that maps EJB Abstract Schema Names from the query statement into Eclass names
    int* pattern the pattern used for containment
     
    * used only when using caller provided schema



Related concepts
Enterprise JavaBeans Data Mediator Service

Related reference
DataGraph schema
Example: EJB mediator query arguments

Task topic    

Terms of Use | Feedback

Last updated: Mar 17, 2005 4:28:29 AM CST
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tejb_ejbmeduse.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)