Why is the value queried in mybatis 3 tables but the value is empty when obtained?

Updated on technology 2024-03-02
10 answers
  1. Anonymous users2024-02-06

    select (field_a, field_b, field_c, field_d,null,null) from test_a, test_b where ..

    That is, there is no need to copy the bai

    You can directly set the field to null.

    zhi to dao up.

  2. Anonymous users2024-02-05

    Just select those fields.

  3. Anonymous users2024-02-04

    This can be solved as follows: select field name 1 + isnull (field name 2, 0) as show field name from table name, and when field name 2 is null, the system will treat it as if it is performing.

  4. Anonymous users2024-02-03

    When you return a record with 0 rows, you can just get the result and determine whether it is null.

    If you want to execute this SQL statement without passing in parameters, try using and.

  5. Anonymous users2024-02-02

    Don't limit yourself to baseresultmap, just create a new class that receives the field value of the corresponding type.

  6. Anonymous users2024-02-01

    According to debug 11-15 23:39:50,458 <=total: 1 (:139).

    You can see that there are query results, but there is no corresponding resulttype= when assigning the value"teacher"Here the teacher path prefix is added, like.

    Unless you have an alias defined in the front.

  7. Anonymous users2024-01-31

    Which statement reports a null exception?。。。

  8. Anonymous users2024-01-30

    First of all, mybatis itself does not determine whether it is a multi-table query, and there is no difference between a multi-table query and a single-table query, you need an object to receive the return value.

    For example: select name, grade from table 1 u, table 2 p where = . Here you find the two fields name and grade from the two tables, then you need to map them to the corresponding objects.

    Create a new VO that contains the objects you want to query and map them one by one.

  9. Anonymous users2024-01-29

    There is no difference between a multi-table query and a single-table query, except that you need to include the result fields of multiple tables at the same time when an object receives the return value. Everything else makes no difference. mybatis itself does not interpret whether it is a multi-table query.

  10. Anonymous users2024-01-28

    I don't understand what it means.,Mybatis multi-table query and single-table query is different?,Isn't it all written in the DAO as an excuse.,The methods inside and the id of the SQL statement in XML correspond to it?,Multi-table query can be written directly in SQL.。

Related questions
7 answers2024-03-02

First, use the left join to completely find out the 1 table, then use the right join to completely find out the 2 tables, and finally merge the results. >>>More

8 answers2024-03-02

Zhang Shibai: It's so familiar, it's in the middle school book, it's in Ningbo?

12 answers2024-03-02

I'm just right for you to use I submitted it to you, please pay attention to check. >>>More

7 answers2024-03-02

Dear Regiment Organization:

I am an ordinary young person, like every young person, I have ideals and ambitions, and I yearn for a better future, and all this needs to have a guiding light, and the Youth League organization is the beacon on the road of young people's progress, so I urgently want to join the Communist Youth League organization. >>>More

33 answers2024-03-02

The effect of variety shows is too heavy, and we must learn to look at problems with a dialectical attitude and watch the show rationally.