Apache web server tutorial - Handling relationships public PersonnelDataModule() { try { jbInit();

Handling relationships public PersonnelDataModule() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { try { sessionBeanConnection.setJndiName(”Personnel”); sessionBeanConnection.addCreateSessionBeanListener(new com.borland.dx.ejb.CreateSessionBeanListener() { public void creating(CreateSessionBeanEvent e) { sessionBeanConnection_creating(e); } }); personnelDataSet.setSessionBeanConnection(sessionBeanConnection); personnelDataSet.setMethodName(”Personnel”); } catch (Exception ex) { } } public static PersonnelDataModule getDataModule() { if (myDM == null) { myDM = new PersonnelDataModule(); } return myDM; } public com.borland.dx.ejb.SessionBeanConnection getSessionBeanConnection() { return sessionBeanConnection; } public com.borland.dx.ejb.EjbClientDataSet getPersonnelDataSet() { return personnelDataSet; } void sessionBeanConnection_creating(CreateSessionBeanEvent e) { } } Handling relationships The EntityBeanProvider automatically flattens relationships. For example, if you have any Employee entity bean that has a getDept() method that returns a Dept, where Dept is an entity bean remote, a DataSet is created that has all the fields in the Employee entity bean plus all the fields in the Dept entity bean (including any hidden columns containing the primary keys of each of the entity beans). Except for Dept.ejbPrimaryKey, the other Dept fields will be read-only. To resolve changes when a one-to-one relationship is involved, you must add an event listener to the EntityBeanProvider because it can t dynamically determine the home of the related entity bean. Chapter 14: Using the DataExpress for EJB components 147
Our facility is located in Orlando, Florida. Our Orlando web hosting data center gives you assurance that your website will work smoothly . Check more in Orlando Web Hosting.

Leave a Reply