Skip Headers

# Merging Table, Descriptor, and Class Files

Previous

Next

Developers who concurrently modify the same existing table, descriptor, or class file will create a merge condition for the following files:

- Table: `<tableName`>`.xml` (one for each table)

- Descriptor: `<descriptorName.type>``.xml` (one for each descriptor)

- Class: `<className>``.xml` (one for each class)

TopLink Workbench changes these files when saving a project if you have changed any of the contents within them (such as adding a mapping to a descriptor, adding an attribute to a class, or a changing a field reference in a table).

If another developer has changed an attribute in a table, descriptor, or class, while you were changing a different mapping on that same descriptor, you will need to merge your project. To merge your project, use this procedure:

1. Perform a file comparison on the specific `.xml` files in merge status (that is, table, descriptor, or class). The file comparison shows the addition or removal of an XML element.

2. Insert the XML script to, or remove from your local `.xml` file to bring it up-to-date with the current files in the source repository.

Merging Files

Another developer has added and checked in the firstName mapping to the Employee class descriptor while you were changing a different mapping on that same descriptor. To merge your work with the newly changed project, use this procedure:

1. Perform a file comparison on the `com.demo.Employee.ClassDescriptor.xml` file located in `<projectRoot>``/Descriptor/` directory that is in merge status.

   The file comparison shows the addition of the `<mapping>` tag and the elements inside that tag:

       <mapping>
           <uses-method-accessing>false</uses-method-accessing>
           <inherited>false</inherited>
           <read-only>false</read-only>
           <instance-variable-name>firstName</instance-variable-name>
           <default-field-names>
               <default-field-name>direct field=</default-field-name>
           </default-field-names>
           <field-handle>
               <field-handle>
                   <table>EMPLOYEE</table>
                   <field-name>F_NAME</field-name>
               </field-handle>
           </field-handle>
       <mapping-class>MWDirectToFieldMapping </mapping-class>
       </mapping>

2. Insert this XML block into your local `com.demo.Employee.ClassDescriptor.xml` file (inside the existing `<mapping>` element) to bring it up to date to the current files in the source repository.

3. Retrieve any new files noted as missing by your source control system. This includes any tables or descriptors that may be referenced by the new mapping.

4. Check in files that you have modified.