欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Dorado EntityState

程序员文章站 2022-07-03 23:33:58
...

实体数据的状态

可转换为数字

public static int toInt(EntityState state) {
		if (state == NONE) {
			return 0;
		}
		if (state == NEW) {
			return 1;
		}
		if (state == MODIFIED) {
			return 2;
		}
		if (state == DELETED) {
			return 3;
		}
		if (state == MOVED) {
			return 4;
		}
		return 0;
	}
public static EntityState fromInt(int i) {
		switch (i) {
		case 0:
			return NONE;
		case 1:
			return NEW;
		case 2:
			return MODIFIED;
		case 3:
			return DELETED;
		case 4:
			return MOVED;
		default:
			return NONE;
		}
	}
相关标签: dorado