-
SimpleJdbcTemplate
Hello guys,
what is the best way to map a row with a composite key? Has anyone a good sample? Does i have to implement two row mappers (one for the table containing this composite primary key and one row mapper for the composite key)? What is the impact of this design?
Example:
Class A has 4 attributes
String aa (identifier)
String ab (some value)
String ac (some value)
int ad (some value)
Class B has 3 attributes
String ba (identifier 1 of composite key)
String bc (identifier 2 of composite key)
int bd (some value)
or does i have to design my second entity with
Class B
MyCompositeKey bac (composite key)
int bd
What is the best design and easiest way to map entities with data access using jdbc with spring and how can i realize it?
In Class B i have a displayNumber bd which i have to query and update afterwards while a limit ad hasn't reached
Kindly Greetings
Ünhan