return update(entityName, id, modelData, restOptions, null);
}
public static Model update(String entityName, Integer id, ModelData modelData, RestOptions restOptions, String factoryName) {
AdaptrexPersistence persistence = Adaptrex.getAdaptrex().getPersistenceManager().getPersistence(factoryName);
AdaptrexSession session = new AdaptrexSession(persistence);
Class<?> clazz = persistence.getEntityClass(entityName);
DataConfig config = new DataConfig(clazz, persistence);
if (restOptions != null) {
config.applyRestOptions(restOptions);
}
Model model = new Model(session, config, id);
updateEntity(session, model, modelData);
session.close();
return model;
}