本文整理汇总了Java中com.litesuits.orm.db.enums.AssignType类的典型用法代码示例。如果您正苦于以下问题:Java AssignType类的具体用法?Java AssignType怎么用?Java AssignType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AssignType类属于com.litesuits.orm.db.enums包,在下文中一共展示了AssignType类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkPrimaryKey
import com.litesuits.orm.db.enums.AssignType; //导入依赖的package包/类
private static void checkPrimaryKey(Primarykey key) {
if (key.isAssignedBySystem()) {
if (!FieldUtil.isNumber(key.field.getType())) {
throw new RuntimeException(
AssignType.AUTO_INCREMENT
+ " Auto increment primary key must be a number ...\n " +
"错误提示:自增主键必须设置为数字类型");
}
} else if (key.isAssignedByMyself()) {
if (String.class != key.field.getType() && !FieldUtil.isNumber(key.field.getType())) {
throw new RuntimeException(
AssignType.BY_MYSELF
+ " Custom primary key must be string or number ...\n " +
"错误提示:自定义主键值必须为String或者Number类型");
}
} else {
throw new RuntimeException(
" Primary key without Assign Type ...\n " +
"错误提示:主键无类型");
}
}
示例2: Primarykey
import com.litesuits.orm.db.enums.AssignType; //导入依赖的package包/类
public Primarykey(Property p, AssignType assign) {
this(p.column, p.field, p.classType, assign);
}
示例3: isAssignedBySystem
import com.litesuits.orm.db.enums.AssignType; //导入依赖的package包/类
public boolean isAssignedBySystem() {
return assign == AssignType.AUTO_INCREMENT;
}
示例4: isAssignedByMyself
import com.litesuits.orm.db.enums.AssignType; //导入依赖的package包/类
public boolean isAssignedByMyself() {
return assign == AssignType.BY_MYSELF;
}