First, sort error code: Example.orderby (BaseEntity.Field.GMTUpdate + "desc"); correct way: first: Through the annotation @OrderBy (value = "desc") The second is: Example.setorderbyclause ("Gmt_update DESC"); note here is the column name, not the property name.
II. handling NULL exceptions for Oracle <?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE configurationpublic "-//mybatis.org//dtd Config 3.0//en" "Http://mybatis.org/dtd/mybatis-3-config.dtd" > <configuration><settings><setting name= "cacheenabled" value= "false"/><!--solve the error when inserting null-- ><setting name= "Jdbctypefornull" value= "NULL"/></settings></configuration>
The SelectOne return value of mapper may be null, and the resulting result should be null-determined.
Four public interface sequencemapper{@Select ("Select Seq_${tablename}.nextval from dual") int getsequence (@Param (" TableName ") String tableName);}
MyBatis General Mapper Tips