mybatis-3 icon indicating copy to clipboard operation
mybatis-3 copied to clipboard

Tag assocation and attribute extends in duplicate records

Open moyuking233 opened this issue 3 years ago • 0 comments

It is utterly confusing to me that using tag assocation and attribute extends . Here is the sql and the result.Basically i just want to select one permission with many roles. image Then,I using java class to resolve them. image 4 records as expected. So I created a dto to handle the duplicate records with 2 different solutions like this: Solution one -- using assocation mapper.xml image java bean image reulst: Still return 4 records. Solution two -- using extends attributes mapper.xml image java bean image result: Return 2 records with List<Role> as expected image After using extends attribute, it working fine so far. I was wandering can assocation do this like that?

moyuking233 avatar Aug 26 '21 03:08 moyuking233