Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between EJB1.0 , EJB1.1 and EJB2.0 & About CMP

 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
1) What is the basic difference between EJB1.0, EJB1.1 and EJB2.0 in the EJB Structure(ie. in the Home interface, Remote Interface and Bean Class).
I knew that in EJB2.0 features Message Driven Bean,local interface.
2) Is it possible in EJB2.0 to define two tables in a CMP. If it so please give the sample programs.
Thanks & Regards,
M.S.Raman.
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can check out the differences in the different specifications:
see here
 
susha pillu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In brief, the EJB 2.0 specification introduces these new features:
Message-driven beans
1. An improved architecture for container-managed persistence
2. Container-managed relationships for entity beans with container-managed persistence
3. Local interfaces
4. Enterprise JavaBeans Query Language
 
Alexander Yanuar Koentjara
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic differences:
1.0:
- no mandate that Entity EJB must be supported by EJB container
- no Message Driven Bean
- EJB communication backbone uses RMI-JRMP
- no CMP Entity EJB
- no Deployment Descriptor xml file, use compiled class, then serializes it into flat file (binary).
1.1:
- Entity Bean must be supported by EJB container
- no Message Driven Bean
- has CMP, but never describe how to configure relationship between CMP EntityEJBs, this depends on container tool provided by vendor
- RMI-IIOP is suggested for EJB communication
- Deployment Descriptor xml file is introduced
2.0:
- Message Driven Bean is introduced
- With CMP, you can configure the relationship between CMP EntityEJBs, in ejb-jar.xml
- EJB-QL for CMP EntityEJB query language
- RMI-IIOP is a must for EJB communication
 
Alexander Yanuar Koentjara
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>2) Is it possible in EJB2.0 to define two tables in a CMP. If it so please give the sample programs.
Cannot. In Web Logic deployment descriptor, you must indicate one table in database for one CMP EntityEJB.
But, for your case, you have several alternatives:
1. declare the secondary table as another Entity EJB, then you can set up the relationship.
2. Use BMP, with DAO to access both primary & secondary table.
3. discard the secondary table, and use blob in main table instead. Then, you can use java serialization method to convert values of secondary table to binary. This only work for 1-1 relationship (example: profile as secondary table in customer table, profile contains name, address, company, telephone. Then you can make a class called ProfileValueObject, use serializable method to convert it into bytes, then store it as blob in customer table)
4. merge the table into one, work only for 1-1 relationship.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic