Fixed bug where new beans where not added to the read cache

This commit is contained in:
Ziver Koc 2016-02-14 18:44:30 +01:00
parent 08b9da1d69
commit f43b5fdbf4

View file

@ -218,8 +218,11 @@ public abstract class DBBean {
// Execute the SQL
DBConnection.exec(stmt);
if( id == null )
this.id = db.getLastInsertID(stmt);
if( id == null ) {
this.id = db.getLastInsertID(stmt);
// as this is a new object so add it to the cache
DBBeanSQLResultHandler.cacheDBBean(this);
}
// Save the list, after we get the object id
for(Field field : config.fields){