#1571 - NPE in cacheable bean with embeddedid on delete

This commit is contained in:
rob bygrave
2018-12-05 23:03:15 +13:00
parent 0405ceb96c
commit e4088c5fbe
16 changed files with 142 additions and 62 deletions
@@ -3,6 +3,7 @@ package io.ebeaninternal.server.deploy;
import io.ebean.bean.EntityBean;
import io.ebean.bean.PersistenceContext;
import io.ebeaninternal.server.query.SqlJoinType;
import io.ebeaninternal.server.type.DataReader;
import java.sql.SQLException;
@@ -28,6 +29,24 @@ abstract class AssocOneHelp {
property.targetIdBinder.loadIgnore(ctx);
}
/**
* Read and return the property.
*/
Object read(DataReader reader) throws SQLException {
return property.read(reader);
}
/**
* Read and return the property setting value into the bean.
*/
Object readSet(DataReader reader, EntityBean bean) throws SQLException {
Object val = read(reader);
if (bean != null) {
property.setValue(bean, val);
}
return val;
}
/**
* Read and return the bean.
*/