L
Last Timer
I'm following Sam's Teach Yourself J2EE. I just can't seem to
understand the entity bean chapter. Here is how the book lays out the
entity bean:
import java.rmi.*;
import java.util.*;
import java.ejb.*;
public interface JobLocalHome extends EJBLocalHome
{
JobLocal create(String ref, String customer) throws CreateException;
....
}
public class JobBean implements EntityBean
{
...
}
public interface JobLocal extends EJFLocalObject
{
String getRef();
String getCustomer();
CustomerLocal getCustomerObj(); //derived
...
void setLocation(LocaltionLocal location);
LocationLocal getLocation();
...
}
And the authors say "note that the setLocation() method accepts a
LocationLocal reference rather than say a String containing the name of
a location. In other words, the Job bean is defining its relationship
to the Location bean directly, effectively enforcing referential
integrity"
I'm thinking LocationLocalHome a la aforementioned JobLocalHome
interface must've been left out of the book. Am I right?
public interface LocatonLocalHome extends EJBLocalHome
{
JobLocal create(String ref, String customer) throws CreateException;
....
}
Your help is appreciated.
Thank you
understand the entity bean chapter. Here is how the book lays out the
entity bean:
import java.rmi.*;
import java.util.*;
import java.ejb.*;
public interface JobLocalHome extends EJBLocalHome
{
JobLocal create(String ref, String customer) throws CreateException;
....
}
public class JobBean implements EntityBean
{
...
}
public interface JobLocal extends EJFLocalObject
{
String getRef();
String getCustomer();
CustomerLocal getCustomerObj(); //derived
...
void setLocation(LocaltionLocal location);
LocationLocal getLocation();
...
}
And the authors say "note that the setLocation() method accepts a
LocationLocal reference rather than say a String containing the name of
a location. In other words, the Job bean is defining its relationship
to the Location bean directly, effectively enforcing referential
integrity"
I'm thinking LocationLocalHome a la aforementioned JobLocalHome
interface must've been left out of the book. Am I right?
public interface LocatonLocalHome extends EJBLocalHome
{
JobLocal create(String ref, String customer) throws CreateException;
....
}
Your help is appreciated.
Thank you