DatastoreContainerObject datastoreContainer,
DatastoreMapping mapping,
byte[] bytes)
{
// Generate "SELECT {blobColumn} FROM TABLE WHERE ID=? FOR UPDATE" statement
FetchStatement fetchStmt = new RDBMSFetchStatement(datastoreContainer);
fetchStmt.select(mapping.getDatastoreField());
JavaTypeMapping idMapping = datastoreContainer.getIDMapping();
for (int i = 0; i < idMapping.getNumberOfDatastoreFields(); i++)
{
fetchStmt.andCondition(fetchStmt.referenceDatastoreField(idMapping.getDataStoreMapping(i).getDatastoreField()) + " = ?");
}
String textStmt = fetchStmt.toString(true);
if (sm.getPcObjectType() != StateManager.PC)
{
// This mapping is embedded, so navigate back to the real owner since that is the "id" in the table
StateManager[] embeddedOwners = sm.getEmbeddedOwners();