MetaClass metaClass = metaInfo.getMetaClass(cl);
if(metaClass == null)
throw new IllegalArgumentException("Entity type="+entity.getClass().getName()+" was not scanned and added to meta information on startup. It is either missing @NoSqlEntity annotation or it was not in list of scanned packages");
boolean needRead = false;
MetaIdField idField = metaClass.getIdField();
Object id = metaClass.fetchId(entity);
if(idField.isAutoGen() && id != null && !(entity instanceof NoSqlProxy)) {
//We do NOT have the data from the database IF this is NOT a NoSqlProxy and we need it since this is an
//update
needRead = true;
}
putImpl(entity, needRead, metaClass);