Mybatis generates sql to deal with keyword fields in sql

tags: Java

SELECT id,version,new String("`name`"),`type`,create_time,last_used_time,code,source_code,card_url,small_logo_url,big_logo_url,params FROM lib_express_company WHERE id = ? 
The name field in the above code producednew String, Because name is a keyword in sql, you need to add `to the keyword to make it a column name (such as: `name` ,Note that this is not a single quote', it is in1`Sign on the left)
 Can use annotations@Column(name = "`name`")

Intelligent Recommendation

Mybatis sql query interception achieve unity deal

1, to achieve interception interfaces Mybatis provides an interface to intercept, by implementing this interface, with springMVC configuration, sql complete interception. 2, xml configuration Find myb...

Mybatis query results return in order of SQL fields.

1. Return the result with resutlfype to accept: 2、 Mybatis-plus adds the following configuration:...

When Mybatis dynamic SQL generates query SQL, the primary key id condition constructed by lambda expression, the field alias AS keyword appears in the query condition after where, which causes an exception during SQL execution;

When Mybatis dynamic SQL generates query SQL, the primary key id condition constructed by lambda expression, the field alias AS keyword appears in the query condition after where, which causes an exce...

Use a keyword (word) in SQL to match multiple fields (or attributes) in the table

1. Common SQL query 2. Multi -field query The above is the specific implementation of SQL....

More Recommendation

Mybatis single table automatically generates SQL

1. Why do you want to write a single table SQL automatically generated? When we use Mybatis for dao layer development, most of the operations on a single table are the same. Every time we write the sa...

Mybatis generates some sql usage of mapper.xml file

First, selectable insert data insertSelective The running sql statement is Second multiple conditional selectable query This complex prediction condition above is added to n.CITY_NO, n.SUBSIDY_TYPE, n...

mybatis+sql server+maven automatically generates code

Compared with mybatis automatically generated mysql code, the main difference is 1. Add sqlserver dependency to pom file (you need to download and install it yourself, it seems that the new version of...

MBG (Mybatis generator) automatically generates sql statements

Learning official website http://www.mybatis.org/generator/ Plugin with pagination Create a simple maven project Create an mbg.xml file under the src/main/java package Configure the plug-ins needed to...

Mybatis-Plus BaseMapper automatically generates SQL and MapperProxy

Mybatis-Plus BaseMapper automatically generates SQL and MapperProxy     table of Contents Spring+Mybatis + Mybatis-Plus custom XML-free sql generation and MapperProxy proxy generation Backgr...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top