How mybatis handles many-to-many inserts relatively easily

1. The current table structure partition is

.
  • the main table is an and contains the necessary underlying data.
  • from the table: B, c, d, e, etc.
  • related tables: ab, ac, ad, ae, etc.

now the data sent from the front end is a string of json strings, the structure of which is:

public class A{
    private B b;
    private C b;
    private D b;
    private E b;
}

and may change later, so I would like to know how to solve this insertion and update problem in a simpler or flexible way. The current orm framework is mybatis,. Please also know or have done some experience, thank you here.


is to write the mapper of BMageCMagee DMagee E. Then call it sequentially in service. If you want to ensure data consistency, put it in a transaction.


the many-to-many relationship doesn't seem to be like this. Shouldn't a contain a collection of associated objects

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3842b-2c10a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3842b-2c10a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?