int update(Object entity)
更新单个实体,实体的类型必须与数据库表存在映射关系的类型,并且id不为null
参数:
结果:
int[] batchUpdate(List<?> entities)
批量更新数据库记录
int[] batchUpdate(Object[] entities)
效果与int[] batchUpdate(List<?> entities)相同,仅参数传递的类型不同.
int[] batchUpdate(String entityName, List<?> records)
将对象列表的数据更新到指定的数据库表中.
int[] batchUpdate(String entityName, Object[] records)
效果与int[] batchUpdate(String entityName, List<?> records)相同,仅参数传递的类型不同
int[] batchUpdate(Class<?> entityClass, List<?> records)
效果与int[] batchUpdate(String entityName, List<?> records)相同,但是数据库表的映射实体类通过类实例传递
int[] batchUpdate(Class<?> entityClass, Object[] records)
效果与int[] batchUpdate(String entityName, Object[] records)相同,但是数据库表的映射实体类通过类实例传递
int[] batchUpdate(EntityMapping em, List<?> records)
效果与int[] batchUpdate(String entityName, List<?> records)相同,但是数据库表以实体映射对象指定,EntityMapping对象可以用过Dao.getOrmContext().getMetadata().getEntityMapping(entity.class)获取
Dao.getOrmContext().getMetadata().getEntityMapping(entity.class)
int[] batchUpdate(EntityMapping em, Object[] records)
效果与int[] batchUpdate(String entityName, Object[] records)相同,但是数据库表以实体映射对象指定.