use of org.hibernate.type.OneToOneType in project hibernate-orm by hibernate.
the class AuditMetadataGenerator method addValueInSecondPass.
private void addValueInSecondPass(Element parent, Value value, CompositeMapperBuilder currentMapper, String entityName, EntityXmlMappingData xmlMappingData, PropertyAuditingData propertyAuditingData, boolean insertable, boolean processModifiedFlag) {
final Type type = value.getType();
if (type instanceof ComponentType) {
componentMetadataGenerator.addComponent(parent, propertyAuditingData, value, currentMapper, entityName, xmlMappingData, false);
// mod flag field has been already generated in first pass
return;
} else if (type instanceof ManyToOneType) {
toOneRelationMetadataGenerator.addToOne(parent, propertyAuditingData, value, currentMapper, entityName, insertable);
} else if (type instanceof OneToOneType) {
final OneToOne oneToOne = (OneToOne) value;
if (oneToOne.getReferencedPropertyName() != null) {
toOneRelationMetadataGenerator.addOneToOneNotOwning(propertyAuditingData, value, currentMapper, entityName);
} else {
// @OneToOne relation marked with @PrimaryKeyJoinColumn
toOneRelationMetadataGenerator.addOneToOnePrimaryKeyJoinColumn(propertyAuditingData, value, currentMapper, entityName, insertable);
}
} else if (type instanceof CollectionType) {
final CollectionMetadataGenerator collectionMetadataGenerator = new CollectionMetadataGenerator(this, (Collection) value, currentMapper, entityName, xmlMappingData, propertyAuditingData);
collectionMetadataGenerator.addCollection();
} else {
return;
}
addModifiedFlagIfNeeded(parent, propertyAuditingData, processModifiedFlag);
}
Aggregations