HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML
 

"Building E-Commerce Applications Using
 Business Components for Java"
Vol 5 Issue 6, p.24

	

Listing 1: Donations Table in XML format 

<?xml version="1.0" encoding='WINDOWS-1252'?> 
<!DOCTYPE Entity SYSTEM "jbo_03_01.dtd"> 

<Entity 
  Name="Donations" 
   DBObjectType="table" 
   DBObjectName="DONATIONS" 
   AliasName="Donations" 
   BindingStyle="Oracle" 
   CodeGenFlag="4" 
   RowClass="netu.DonationsImpl" > 
   <DesignTime> 
      <Attr Name="_isCodegen" Value="true" /> 
      <AttrArray Name="_publishEvents"> 
      </AttrArray> 
   </DesignTime> 
   <Attribute 
      Name="DonationNo" 
      Type="oracle.jbo.domain.Number" 
      ColumnName="DONATION_NO" 
      ColumnType="NUMBER" 
      SQLType="NUMERIC" 
      IsNotNull="true" 
      Precision="8" 
      Scale="0" 
      TableName="DONATIONS" 
      PrimaryKey="true" > 
      <DesignTime> 
         <Attr Name="_DisplaySize" Value="0" /> 
      </DesignTime> 
   </Attribute> 
   <Attribute 
      Name="Id" 
      Type="oracle.jbo.domain.Number" 
      ColumnName="ID" 
      ColumnType="NUMBER" 
      SQLType="NUMERIC" 
      IsNotNull="true" 
      Precision="5" 
      Scale="0" 
      TableName="DONATIONS" > 
      <DesignTime> 
         <Attr Name="_DisplaySize" Value="0" /> 
      </DesignTime> 
   </Attribute> 
   <Attribute 
      Name="Fund" 
      Type="java.lang.String" 
      ColumnName="FUND" 
      ColumnType="VARCHAR2" 
      SQLType="VARCHAR" 
      Precision="20" 
      TableName="DONATIONS" > 
      <DesignTime> 
         <Attr Name="_DisplaySize" Value="20" /> 
      </DesignTime> 
   </Attribute> 
   <Attribute 
      Name="Restriction" 
      Type="java.lang.String" 
      ColumnName="RESTRICTION" 
      ColumnType="VARCHAR2" 
      SQLType="VARCHAR" 
      Precision="15" 
      TableName="DONATIONS" > 
      <DesignTime> 
         <Attr Name="_DisplaySize" Value="15" /> 
      </DesignTime> 
   </Attribute> 
   <Attribute 
      Name="Amount" 
      Type="oracle.jbo.domain.Number" 
      ColumnName="AMOUNT" 
      ColumnType="NUMBER" 
      SQLType="NUMERIC" 
      Precision="10" 
      Scale="0" 
      TableName="DONATIONS" > 
      <DesignTime> 
         <Attr Name="_DisplaySize" Value="0" /> 
      </DesignTime> 
   </Attribute> 
   <Attribute 
      Name="GiftDate" 
      Type="oracle.jbo.domain.Date" 
      ColumnName="GIFT_DATE" 
      ColumnType="DATE" 
      SQLType="DATE" 
      TableName="DONATIONS" > 
      <DesignTime> 
         <Attr Name="_DisplaySize" Value="7" /> 
      </DesignTime> 
   </Attribute> 
   <Attribute 
      Name="CheckNumber" 
      Type="oracle.jbo.domain.Number" 
      ColumnName="CHECK_NUMBER" 
      ColumnType="NUMBER" 
      SQLType="NUMERIC" 
      Precision="4" 
      Scale="0" 
      TableName="DONATIONS" > 
      <DesignTime> 
         <Attr Name="_DisplaySize" Value="0" /> 
      </DesignTime> 
   </Attribute> 
   <AccessorAttribute 
      Name="Alumni" 
      Association="netu.DonationsFk1Assoc" 
      AssociationEnd="netu.DonationsFk1Assoc.Alumni" 
      AssociationOtherEnd="netu.DonationsFk1Assoc.Donations" 
      Type="AlumniImpl" > 
   </AccessorAttribute> 
   <AccessorAttribute 
      Name="RestrictCodes" 
      Association="netu.DonationsFk2Assoc" 
      AssociationEnd="netu.DonationsFk2Assoc.RestrictCodes" 
      AssociationOtherEnd="netu.DonationsFk2Assoc.Donations" 
      Type="RestrictCodesImpl" > 
   </AccessorAttribute> 
   <Key 
      Name="DonationsPk" > 
      <DesignTime> 
         <Attr Name="_DBObjectName" Value="DONATIONS_PK" /> 
         <Attr Name="_isPrimary" Value="true" /> 
         <Attr Name="_isNotNull" Value="false" /> 
         <Attr Name="_isUnique" Value="false" /> 
         <Attr Name="_isCheck" Value="false" /> 
         <Attr Name="_isCascadeDelete" Value="false" /> 
         <Attr Name="_isDeferrableConstraint" Value="true" /> 
         <Attr Name="_isValidateConstraint" Value="false" /> 
         <Attr Name="_isInitiallyDeferredConstraint" 
          Value="true" /> 
         <Attr Name="_isDisabledConstraint" Value="false" /> 
         <AttrArray Name="_attributes"> 
            <Item Value="netu.Donations.DonationNo" /> 
         </AttrArray> 
      </DesignTime> 
   </Key> 
   <Key 
      Name="DonationsFk1" > 
      <DesignTime> 
         <Attr Name="_DBObjectName" Value="DONATIONS_FK1" /> 
         <Attr Name="_referencedKey" Value="ALUMNI_PK" /> 
         <Attr Name="_isPrimary" Value="false" /> 
         <Attr Name="_isNotNull" Value="false" /> 
         <Attr Name="_isUnique" Value="false" /> 
         <Attr Name="_isCheck" Value="false" /> 
         <Attr Name="_isCascadeDelete" Value="false" /> 
         <Attr Name="_isDeferrableConstraint" Value="true" /> 
         <Attr Name="_isValidateConstraint" Value="false" /> 
         <Attr Name="_isInitiallyDeferredConstraint" 
          Value="true" /> 
         <Attr Name="_isDisabledConstraint" Value="false" /> 
         <AttrArray Name="_attributes"> 
            <Item Value="netu.Donations.Id" /> 
         </AttrArray> 
      </DesignTime> 
   </Key> 
   <Key 
      Name="DonationsFk2" > 
      <DesignTime> 
         <Attr Name="_DBObjectName" Value="DONATIONS_FK2" /> 
         <Attr Name="_referencedKey" 
          Value="RESTRICT_CODES_PK" /> 
         <Attr Name="_isPrimary" Value="false" /> 
         <Attr Name="_isNotNull" Value="false" /> 
         <Attr Name="_isUnique" Value="false" /> 
         <Attr Name="_isCheck" Value="false" /> 
         <Attr Name="_isCascadeDelete" Value="false" /> 
         <Attr Name="_isDeferrableConstraint" Value="true" /> 
         <Attr Name="_isValidateConstraint" Value="false" /> 
         <Attr Name="_isInitiallyDeferredConstraint" Value="true" /> 
         <Attr Name="_isDisabledConstraint" Value="false" /> 
         <AttrArray Name="_attributes"> 
            <Item Value="netu.Donations.Restriction" /> 
         </AttrArray> 
      </DesignTime> 
   </Key> 
   <Key 
      Name="DonationsFund" > 
      <DesignTime> 
         <Attr Name="_DBObjectName" Value="DONATIONS_FUND" /> 
         <Attr Name="_checkCondition" Value="fund = 
          'Annual Fund' or fund = 'Capital Cam- 
          paign'" /> 
         <Attr Name="_isPrimary" Value="false" /> 
         <Attr Name="_isNotNull" Value="false" /> 
         <Attr Name="_isUnique" Value="false" /> 
         <Attr Name="_isCheck" Value="true" /> 
         <Attr Name="_isCascadeDelete" Value="false" /> 
         <Attr Name="_isDeferrableConstraint" Value="true" /> 
         <Attr Name="_isValidateConstraint" Value="false" /> 
         <Attr Name="_isInitiallyDeferredConstraint" 
          Value="true" /> 
         <Attr Name="_isDisabledConstraint" Value="false" /> 
         <AttrArray Name="_attributes"> 
            <Item Value="netu.Donations.Fund" /> 
         </AttrArray> 
      </DesignTime> 
   </Key> 
   <Key 
      Name="SysC002937" > 
      <DesignTime> 
         <Attr Name="_DBObjectName" Value="SYS_C002937" /> 
         <Attr Name="_checkCondition" Value=""ID" IS 
          NOT NULL" /> 
         <Attr Name="_isPrimary" Value="false" /> 
         <Attr Name="_isNotNull" Value="false" /> 
         <Attr Name="_isUnique" Value="false" /> 
         <Attr Name="_isCheck" Value="true" /> 
         <Attr Name="_isCascadeDelete" Value="false" /> 
         <Attr Name="_isDeferrableConstraint" Value="true" /> 
         <Attr Name="_isValidateConstraint" Value="false" /> 
         <Attr Name="_isInitiallyDeferredConstraint" 
          Value="true" /> 
         <Attr Name="_isDisabledConstraint" Value="false" /> 
         <AttrArray Name="_attributes"> 
            <Item Value="netu.Donations.Id" /> 
         </AttrArray> 
      </DesignTime> 
   </Key> 
</Entity> 

Listing 2: EJB Home and CORBA Stub for NETU 

import netu.*; 
import oracle.jbo.common.remote.*; 
import oracle.jbo.common.remote.corba.*; 

// --- File generated by Oracle Business Components for Java. 
  

public class NetuModuleServerVB extends oracle.jbo.server.remote.corba.vb.VBrokerApplicationModule { 

  public NetuModuleServerVB() { 
    init(); 
  } 

  protected void init() { 
    setRemoteInterfaceClass(RemoteApplicationModuleOpera- 
                          tions.class); 
    setTieClass(_tie_RemoteApplicationModule.class); 
    setApplicationModuleDefName("netu.NetuModule"); 
  } 

  public static void main(String argv[]) { 
    try  { 
      new netu.server.vb.NetuModuleServerVB().initServer(argv); 
    } 
    catch (Exception ex) { 
      ex.printStackTrace(); 
    } 
  } 
} 
  
  

package netu.common.ejb; 

import oracle.jbo.common.remote.ejb.*; 
import oracle.jbo.common.remote.*; 

// --- File generated by Oracle Business Components for Java. 

public interface NetuModuleHome extends javax.ejb.EJBHome { 

  RemoteNetuModule create() throws java.rmi.RemoteException, javax.ejb.CreateException; 

  RemoteNetuModule create(SessionInfo info) throws java.rmi.RemoteException,
   javax.ejb.CreateException; 

  RemoteNetuModule create(RemoteApplicationModule parent, String amName) throws
   java.rmi.RemoteException, javax.ejb.CreateException; 

  RemoteNetuModule create(RemoteApplicationModule parent, String amName, String amDefName)
   throws java.rmi.RemoteException, javax.ejb.CreateException; 
  
  } 
  



 

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.