// If that's a OneToOne check the associated property name and see if it matches where we come from
// we need to do that as OneToOne don't define columns
OneToOneType oneToOneType = (OneToOneType) type;
String associatedProperty = oneToOneType.getRHSUniqueKeyPropertyName();
if ( associatedProperty != null ) {
OgmEntityPersister mainSidePersister = (OgmEntityPersister) oneToOneType.getAssociatedJoinable( session.getFactory() );
try {
int propertyIndex = mainSidePersister.getPropertyIndex( associatedProperty );
return mainSidePersister.getPropertyTypes()[propertyIndex] == propertyType;
}
catch ( HibernateException e ) {
//not the right property
//probably should not happen
}