2.7.22 @IdClass

Organization of this subsection
(1) Description
(2) Element

(1) Description

This annotation specifies the compound primary key class mapped to multiple fields or properties of the entity class.

This annotation is applicable to the mapped superclass or entity class.

The name and type of the field or property of the compound primary key class must match with that of the field or property of the primary key of entity class. The name and type specified in this annotation must correspond to the name and type of the property or field of primary key of the entity in which @Id is added.

The applicable target is class.

(2) Element

The following table lists the elements of @IdClass:

Element nameOptional/RequiredElement description
valueRequiredThis element specifies the compound primary key class.

The details of attributes that are supported with Cosminexus JPA provider are as follows:

(a) value element
Type
Class
Description
This element specifies the compound primary key class.
The value that can be specified is the class name.
Default value
None