code: @SuppressWarnings("unchecked")
  	@Override
  	public int update(final Object entity) {
  		@SuppressWarnings("rawtypes")
  		EntityHandler handler = this.getEntityHandler();
  		if (!handler.getEntityType().isInstance(entity)) {
  			throw new IllegalArgumentException("Entity type not supported");
  		}
  
  		try {
  			Class<?> type = entity.getClass();
  			TableMetadata metadata = handler.getMetadata(this.transactionManager, type);
  			SqlContext context = handler.createUpdateContext(this, metadata, type, true);
  			context.setSqlKind(SqlKind.UPDATE);
  			handler.setUpdateParams(context, entity);
  			int count = handler.doUpdate(this, context, entity);
  
  			if (count == 0 && MappingUtils.getVersionMappingColumn(type).isPresent()) {
  				throw new OptimisticLockException(context);
  			}
  			return count;
  		} catch (SQLException e) {
  			throw new EntitySqlRuntimeException(SqlKind.UPDATE, e);
  		}
  	}
docs: {@inheritDoc}
  
  @see jp.co.future.uroborosql.SqlAgent#update(Object)