// bean already existing in the persistence context
EntityBean contextBean = null;
Class<?> localType;
BeanDescriptor<?> localDesc;
IdBinder localIdBinder;
EntityBean localBean;
if (inheritInfo != null) {
InheritInfo localInfo = inheritInfo.readType(ctx);
if (localInfo == null) {
// the bean must be null
localIdBinder = idBinder;
localBean = null;
localType = null;
localDesc = desc;
} else {
localBean = localInfo.createEntityBean();
localType = localInfo.getType();
localIdBinder = localInfo.getIdBinder();
localDesc = localInfo.getBeanDescriptor();
}
} else {
localType = null;
localDesc = desc;
localBean = desc.createEntityBean();
localIdBinder = idBinder;
}
Mode queryMode = ctx.getQueryMode();
PersistenceContext persistenceContext = !readId ? null : ctx.getPersistenceContext();
Object id = null;
if (!readId) {
// report type bean... or perhaps excluding the id for SqlSelect?
} else {
id = localIdBinder.readSet(ctx, localBean);
if (id == null) {
// bean must be null...
localBean = null;
} else {
// check the PersistenceContext to see if the bean already exists