-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
state: fixedFixed by the developerFixed by the developertype: enhancementNew feature or requestNew feature or requestver: 7.2.3Fixed in versionFixed in versionver: 7.3.0Fixed in versionFixed in version
Milestone
Description
Since id of such entities is passed as object it's not possible to call some methods where id is used in path fragment
DELETE /entities/{entityName}/{entityId}
GET /entities/{entityName}/{entityId}
PUT /entities/{entityName}/{entityId}
Solution:
Represent composite key identifier as JSON string and apply base64 URL encoding.
Model:
@Entity(name = "ref$CompositeKeyEntity")
@Table(name = "REF_COMPOSITE_KEY")
public class CompositeKeyEntity extends BaseGenericIdEntity<EntityKey> {
private static final long serialVersionUID = -2538345720324624741L;
@EmbeddedId
private EntityKey id;
@Column(name = "NAME")
private String name;
}
@Embeddable
@MetaClass(name = "ref$EntityKey")
public class EntityKey extends EmbeddableEntity {
@Column(name = "TENANT")
private Integer tenant;
@Column(name = "ENTITY_ID")
private Long entityId;
}
Encoding sample:
- JSON:
{tenant : 1, entityId: 1} - Base 64:
e3RlbmFudCA6IDEsIGVudGl0eUlkOiAxfQ== - GET
/entities/ref$CompositeKeyEntity/e3RlbmFudCA6IDEsIGVudGl0eUlkOiAxfQ==
Original issue: https://youtrack.haulmont.com/issue/PL-9444
Metadata
Metadata
Assignees
Labels
state: fixedFixed by the developerFixed by the developertype: enhancementNew feature or requestNew feature or requestver: 7.2.3Fixed in versionFixed in versionver: 7.3.0Fixed in versionFixed in version