final String propertyName = inferredData.getPropertyName();
LOG.tracev( "Fetching {0} with {1}", propertyName, fetchMode );
boolean mapToPK = true;
if ( !trueOneToOne ) {
//try to find a hidden true one to one (FK == PK columns)
KeyValue identifier = propertyHolder.getIdentifier();
if ( identifier == null ) {
//this is a @OneToOne in a @EmbeddedId (the persistentClass.identifier is not set yet, it's being built)
//by definition the PK cannot refers to itself so it cannot map to itself
mapToPK = false;
}
else {
Iterator idColumns = identifier.getColumnIterator();
List<String> idColumnNames = new ArrayList<String>();
org.hibernate.mapping.Column currentColumn;
if ( identifier.getColumnSpan() != joinColumns.length ) {
mapToPK = false;
}
else {
while ( idColumns.hasNext() ) {
currentColumn = ( org.hibernate.mapping.Column ) idColumns.next();