Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Upgrade and Migration Guide

- Previous: Migrating EJB Client Applications
- Next: Migrating the Bean Class

## To Verify if a Bean Can be Migrated

##### Steps

1. From the `ejb-jar.xml` file, go to the `<cmp-fields>` names and check if the optional tag `<prim-key-field>` is present in the `ejb-jar.xml file` and has an indicated value. If it does, go to next step.

   Look for the `<prim-key-class>` field name in the `ejb-jar.xml`, get the class name and get the `public instance variables` declared in the class. Now see if the signature (name and case) of these variables matches with the `<cmp-field>` names above. Segregate the ones that are found. In these segregated fields, check if some of them start with an upper case letter. If any of them do, then migration cannot be performed.

2. Look into the bean class source code and obtain the java types of all the `<cmp-field>` variables.

3. Change all the `<cmp-field>` names to lowercase and construct accessors from them. For example if the original field name is `Name` and its java type is `String`, the accessor method signature will be:

   `Public void setName(String name)Public String getName()`

4. Compare these accessor method signatures with the method signatures in the bean class. If there is an exact match found, migration is not possible.

5. Get the custom finder methods signatures and their corresponding SQLs. Check if there is a ”Join’ or ”Outer join’ or an ”OrderBy’ in the SQL, if yes, we cannot migrate, as EJB QL does not support ”joins’, ”Outer join’ and ”OrderBy’.

6. Any CMP 1.1 finder, which used `java.util.Enumeration,` must now use `java.util.Collection`. Change your code to reflect this. CMP2.0 finders cannot return j`ava.util.Enumeration`.

   Migrating the Bean Class explains how to perform the actual migration process.

- Previous: Migrating EJB Client Applications
- Next: Migrating the Bean Class

- © 2010, Oracle Corporation and/or its affiliates