final MappedStoreManager storeMgr = (MappedStoreManager)ec.getStoreManager();
return ec.findObject(oid, new FieldValues()
{
public void fetchFields(ObjectProvider sm)
{
FieldManager fm = storeMgr.getFieldManagerForResultProcessing(sm, resultSet,
mappingDefinition);
sm.replaceFields(fieldNumbers, fm, false);
// Set version
if (surrogateVersion != null)
{
// Surrogate version field
sm.setVersion(surrogateVersion);
}
else if (cmd.getVersionMetaData() != null && cmd.getVersionMetaData().getFieldName() != null)
{
VersionMetaData vermd = cmd.getVersionMetaData();
// Version stored in a normal field
int versionFieldNumber = acmd.getMetaDataForMember(vermd.getFieldName()).getAbsoluteFieldNumber();
if (stmtMapping.getMappingForMemberPosition(versionFieldNumber) != null)
{
Object verFieldValue = sm.provideField(versionFieldNumber);
if (verFieldValue != null)
{
sm.setVersion(verFieldValue);
}
}
}
}
public void fetchNonLoadedFields(ObjectProvider sm)
{
FieldManager fm = storeMgr.getFieldManagerForResultProcessing(sm, resultSet,
mappingDefinition);
sm.replaceNonLoadedFields(fieldNumbers, fm);
}
public FetchPlan getFetchPlanForLoading()
{