primaryKeyValues = policy.createPkVectorFromKey(primaryKey, session);
}
// Get the read object query and apply the properties to it.
// PERF: use descriptor defined query to avoid extra query creation.
ReadObjectQuery query = descriptor.getQueryManager().getReadObjectQuery();
if (query == null) {
// The properties/query hints and setIsExecutionClone etc. is set
// in the getReadObjectQuery.
query = getReadObjectQuery(descriptor.getJavaClass(), primaryKeyValues, properties);
} else {
query.checkPrepare(session, null);
query = (ReadObjectQuery)query.clone();
// Apply the properties if there are some.
QueryHintsHandler.apply(properties, query, session.getLoader());
query.setIsExecutionClone(true);
query.setSelectionKey(primaryKeyValues);
}
// Apply any EclipseLink defaults if they haven't been set through
// the properties.
if (properties == null || ! properties.containsKey(QueryHints.CACHE_USAGE)) {
query.conformResultsInUnitOfWork();
}
return executeQuery(query, lockMode, (UnitOfWork) session);
}