public static MappingInfo createMappingInfo(PK pk, Field field) {
        MappingInfo info = create(MappingInfo.class, field);
        info.annPK = pk;
        info.annColumn = field.getAnnotation(Column.class);
        info.annDefine = field.getAnnotation(ColDefine.class);
        info.annDefault = field.getAnnotation(Default.class);
        info.annId = field.getAnnotation(Id.class);
        info.annName = field.getAnnotation(Name.class);
        info.annNext = field.getAnnotation(Next.class);
        info.annPrev = field.getAnnotation(Prev.class);
        info.annReadonly = field.getAnnotation(Readonly.class);
        info.columnComment = field.getAnnotation(Comment.class);
        
        //检查@Id和@Name的属性类型
        if (info.annId != null) {
            if (!Mirror.me(field.getType()).isIntLike())
                throw Lang.makeThrow(DaoException.class, "Field(%s) annotation @Id , but not Number type!!", field);
        }
        
        if (info.annName != null)
            if (!Mirror.me(field.getType()).isStringLike())
                throw Lang.makeThrow(DaoException.class, "Field(%s) annotation @Name , but not String type!!", field);
        //检查@Version属性类型，必须是int、long、short
        if (info.annColumn != null && info.annColumn.version()){
        	Mirror<?> mirror =Mirror.me(field.getType());
        	if (!mirror.isInt() && !mirror.isShort() && !mirror.isLong())
        		throw Lang.makeThrow(DaoException.class, "Field(%s) define version=true , but not  int\\long\\short type!", field);
        }
        
        return info;
    }
public static MappingInfo createMappingInfo(PK pk, Field field) {
        MappingInfo info = create(MappingInfo.class, field);
        info.annPK = pk;
        info.annColumn = field.getAnnotation(Column.class);
        info.annDefine = field.getAnnotation(ColDefine.class);
        info.annDefault = field.getAnnotation(Default.class);
        info.annId = field.getAnnotation(Id.class);
        info.annName = field.getAnnotation(Name.class);
        info.annNext = field.getAnnotation(Next.class);
        info.annPrev = field.getAnnotation(Prev.class);
        info.annReadonly = field.getAnnotation(Readonly.class);
        info.columnComment = field.getAnnotation(Comment.class);
        
        
        if (info.annId != null) {
            if (!Mirror.me(field.getType()).isIntLike())
                throw Lang.makeThrow(DaoException.class, "Field(%s) annotation @Id , but not Number type!!", field);
        }
        
        if (info.annName != null)
            if (!Mirror.me(field.getType()).isStringLike())
                throw Lang.makeThrow(DaoException.class, "Field(%s) annotation @Name , but not String type!!", field);
        
        if (info.annColumn != null && info.annColumn.version()){
        	Mirror<?> mirror =Mirror.me(field.getType());
        	if (!mirror.isInt() && !mirror.isShort() && !mirror.isLong())
        		throw Lang.makeThrow(DaoException.class, "Field(%s) define version=true , but not  int\\long\\short type!", field);
        }
        
        return info;
    }
public static MappingInfo createMappingInfo ( PK pk , Field field ) { MappingInfo info = create ( MappingInfo . class , field ) ; info . annPK = pk ; info . annColumn = field . getAnnotation ( Column . class ) ; info . annDefine = field . getAnnotation ( ColDefine . class ) ; info . annDefault = field . getAnnotation ( Default . class ) ; info . annId = field . getAnnotation ( Id . class ) ; info . annName = field . getAnnotation ( Name . class ) ; info . annNext = field . getAnnotation ( Next . class ) ; info . annPrev = field . getAnnotation ( Prev . class ) ; info . annReadonly = field . getAnnotation ( Readonly . class ) ; info . columnComment = field . getAnnotation ( Comment . class ) ; //检查@Id和@Name的属性类型 if ( info . annId != null ) { if ( ! Mirror . me ( field . getType ( ) ) . isIntLike ( ) ) throw Lang . makeThrow ( DaoException . class , "Field(%s) annotation @Id , but not Number type!!" , field ) ; } if ( info . annName != null ) if ( ! Mirror . me ( field . getType ( ) ) . isStringLike ( ) ) throw Lang . makeThrow ( DaoException . class , "Field(%s) annotation @Name , but not String type!!" , field ) ; //检查@Version属性类型，必须是int、long、short if ( info . annColumn != null && info . annColumn . version ( ) ) { Mirror < ? > mirror = Mirror . me ( field . getType ( ) ) ; if ( ! mirror . isInt ( ) && ! mirror . isShort ( ) && ! mirror . isLong ( ) ) throw Lang . makeThrow ( DaoException . class , "Field(%s) define version=true , but not  int\\long\\short type!" , field ) ; } return info ; }
根据 Java 字段创建一个实体字段信息对象

@param pk
复合主键
@param field
Java 字段
@return 字段信息对象
根据 Java 字段创建一个实体字段信息对象