Skip to content

How Overwrite the GET action to access a composite primary key #1376

Description

@lvillarino

Hi,

I want to know how I can overwrite the GET action to accept a composite primary key.
My current GET action is /entity/{id} and I want to be /entity/{r1}/{r2}/{r3}

My table don't have an unique primary key ID at this time

CREATE TABLE `table_name` (
  `r1` smallint(5) unsigned NOT NULL DEFAULT '0',
  `r2` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `r3` enum('A','B','C') NOT NULL DEFAULT 'A',
  `r4` varchar(255) DEFAULT NULL,
  `r5` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`r1`,`r2`,`r3`),
  KEY `table_name_001` (`r2`),
  KEY `table_name_002` (`r5`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

and I can't modify the table

Thanks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions