• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Tutorial that covers EJB CMP/CMR and EJB-QL

 
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Enterprise JavaBeans (EJB) 2.0 extends the earlier version 1.1 by adding advanced support for EntityBeans..."
"Once you get the hang of CMP/CMR, it is faster to write EntityBeans using this technology, than using low-level JDBC inside of bean-managed persistence (BMP) beans . "
"..you do not have to write low-level JDBC calls, and you do not have to write code to manage relationships. It is all built into the EJB framework. Your interface to relationships is through the pervasive java.util.Collection and java.util.Set which most EJB developers are already familiar with."
"EJB 2.0 added a lot of features and functionality, this tutorial focuses on CMP/CMR. Thus, this tutorial assumes you have a background with EJB, and EntityBeans. You don't have to be an EJB expert to follow along. The tutorials cover local interfaces, deployment descriptor CMP, CMR fields, and relationship elements. I will also cover the full range of relationship types as follows:
One-to-one One-to-many Many-to-many
The relationships in the example also cover both unidirectional support and bidirectional support. The relationships are defined in XML deployment descriptors.
In the first tutorial, you get a taste of CMP/CMR and EJB-QL, then I will delve into an example of a simple EJB 2.0 style CMP EntityBean. Part of the example demonstrates simple EJB-QL to create a finder method without a Java implementation. This tutorial is just to get you acclimated to the terminology and technology and it adds a teaser example. The next part, the second tutorial, does the heavy lifting.
In the second tutorial, I will build on the first example to eventually cover each type of relationship and each type of direction (both unidirectional and bidirectional form). Each example also has a client that demonstrates accessing the relationships to add, remove, and change related members. Lastly, cascade-delete is demonstrated with consequences for both the one-to-one relationship example and the one-to-many relationship.
In the third tutorial, I will demonstrate advance EJB-QL to build finder and select methods. This tutorial uses the relationships I built in the last tutorial to show the ends and outs of EJB-QL.
"Each example includes source code as follows: Deployment Descriptor, Implementation class files, Interface class files, Home Interface class files, and an Ant build script. For these examples I will use the J2EE reference implementation which ships with Cloudscape RDBMS system."
http://www-105.ibm.com/developerworks/educat ion.nsf/webservices-onlinecourse-bytitle/B6C04F7C5DB8A7ED86256B65004AD53E?OpenDocument

If you like this free tutorial on IBM developerWorks. Perhaps you will like my new book
Java Tools for Extreme Programming
--Rick Hightower
[ March 13, 2002: Message edited by: Rick Hightower ]
 
Why is the word "abbreviation" so long? And this ad is so short?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic