Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An enity java bean, as you know, represents a row in the database table. An entity java bean only have getter and setter methods for the fields in the table. It does not have properties (variables) and it does not have any other methods than the getter/setter and methods in the EntityBean interface (note that by putting it this way I did not have to write that enity beans can't have business methods as I refuse to refere to so called business methods with the word business methods. Let's not have advertising people controling our way of talking and by that also our way of thinking, shall we. And also I must admit, that entity EJB can, but should not, have methods that I refuse to refere to as business methods). The entity bean is also always abstract.

...

Code Block
java
java
package myphonebookpak;
import javax.ejb.*;
public interface MyPhonebookLocalHome extends EJBLocalHome {
   public MyPhonebookLocal create() throws javax.ejb.CreateException;
   public MyPhonebookLocal findByPrimaryKey(String pk) throws FinderException;
}
}

The

...

findByPrimaryKey

...

is

...

like

...

a

...

SQL

...

select

...

statement

...

(Select

...

*

...

from

...

phonebook

...

where

...

name

...

=

...

?).

...


This

...

is

...

the

...

local

...

interface

...

called

...

MyPhonebookLocal:

Code Block
java
java

{
package myphonebookpak;
import javax.ejb.*;
public interface MyPhonebookLocal extends EJBLocalObject
{
   public String getName() ;
   public void setName(String name ) ;
   public String getNumber() ;
   public void setNumber(String number ) ;

}

...