Provided are a computer implemented method, system, and program for
translating a class schema in a source language to a target language.
Class element definitions in a source file in the source language are
received. The definitions of the class elements define instances of
metadata types providing metadata for the class elements. Statements in
the target language are generated to implement class elements defined in
the source file. Statements are generated in the target language to
define metadata elements for metadata types. For each metadata data type
instance defined with one class element in the source file, at least one
statement is generated in the target language to associate the metadata
element generated for the metadata type with the implementation of the
class element corresponding to the class element defined with the
metadata type instance in the source file.