Introduction to mybaits aliases

typeAliases aliases 

1.1 Requirements

In mapper.xml, many statements are defined. The statement requires parameterType to specify the type of input parameters, and resultType to specify the mapping type of the output result.

 

If you enter the full path of the type when specifying the type, it is not convenient for development. You can define some aliases for the type specified by parameterType or resultType, and define the alias in mapper.xml to facilitate development.

1.2 mybatis supports aliases by default

 

alias

type of mapping

_byte

byte

_long

long

_short

short

_int

int

_integer

int

_double

double

_float

float

_boolean

boolean

string

String

byte

Byte

long

Long

short

Short

int

Integer

integer

Integer

double

Double

float

Float

boolean

Boolean

date

Date

decimal

BigDecimal

bigdecimal

BigDecimal

1.3 Custom Aliases

 

1.3.1 Single Alias ​​Definition

           

1.3.2 Referencing aliases

        

1.3.3 Define aliases in batches (commonly used)

      

 

 The alias part is more commonly used, practice more

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324936258&siteId=291194637