Defining the primary key type

Define an entity bean’s primary key as one of the following:

An IDL structure The structure should reflect the primary key for the database relation that the entity bean represents. In other words, add a field for each column in the primary key. Define the structure to match the intended Java package and class name. For example, if the Java class is to be foo.bar.PK1, define a new structure PK1 in module foo::bar. See “Creating IDL types, exceptions, and interfaces” for more information.

The name of a serializable Java class Enter the name of a serializable Java class, for example: foo.bar.MyPK.

The IDL string type Use string if the key relation has only a string column. In Java, the mapped primary key is java.lang.String.

NoteInteroperability and key types Define your entity bean’s primary key as an IDL structure or string if other types of clients besides Java will use the bean.