MyBatis_typeAliases

       typeAliases是为了减少类名的长度来设置的。

       例如:


	    


 

       上述的以后使用net.mybatis.model.User则可以使用User来代替,这些的基础是只能够在配置文件中使用。

       当然,也可以通过扫描包的形式来进行:


	    


 

       另外,也可通过声明的形式,譬如:

package net.mybatis.model;

import org.apache.ibatis.type.Alias;

@Alias("User")
public class User {
	private String name;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Override
	public String toString(){
		return this.getClass().getName()+":[name:"+this.name+"]";
	}
}


 

        这些个可以理解为是一种别名。

        下面是系统的别名。

 

Alians

Type

_byte

btye

_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

date

Date

decimal

BigDecimal

bigdecimal

BigDecimal

object

Object

map

Map

hashmap

HashMap

list

List

arraylist

ArrayList

collection

Collection

iterator

Iterator

 

你可能感兴趣的:(IT)