It's a question from MAPPER

Asked 1 years ago, Updated 1 years ago, 119 views

I'm planning a car rental system

We are implementing a function that shows the rental area on the next screen after inserting the rental area and the return area on the web.

There are other columns in the table column, but can I put only certain columns in the mapper? Or do I have to insert everything?

dbms insert oracle sql

2022-09-21 10:54

1 Answers

For now, the query mapper literally only functions to create a query, so the question, Mybatis, and Spring are not related.

So let's just think about the query.

CREATE TABLE MY_TABLE(
    COL1 NUMBER,
    COL2 NUMBER,
    COL3 NUMBER
);

INSERT INTO MY_TABLE(
    COL1, COL2
) VALUES (
    123, 456
);

Even if there are three defined columns, INSERT can only specify some columns. However, since null is automatically inserted in the omitted column, there is a condition that the column should be allowed null.

If you look at the table definition attached by the author of the brute, all columns (assuming that that shot is all) do not allow NN, or null. So you can't omit any columns in this situation.


2022-09-21 10:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.