else if ( rootClass.getIdentifierProperty() != null ) {
private void updatePrimaryKey(RootClass rc, PrimaryKeyInfo pki) { SimpleValue idValue = (SimpleValue) rc.getIdentifierProperty().getValue(); Properties defaultStrategyProperties = new Properties(); Property constrainedOneToOne = getConstrainedOneToOne(rc); if(constrainedOneToOne!=null) { if(pki.suggestedStrategy==null) { idValue.setIdentifierGeneratorStrategy("foreign"); } if(pki.suggestedProperties==null) { defaultStrategyProperties.setProperty("property", constrainedOneToOne.getName()); idValue.setIdentifierGeneratorProperties(defaultStrategyProperties); } } }
private void updatePrimaryKey(RootClass rc, PrimaryKeyInfo pki) { SimpleValue idValue = (SimpleValue) rc.getIdentifierProperty().getValue(); Properties defaultStrategyProperties = new Properties(); Property constrainedOneToOne = getConstrainedOneToOne(rc); if(constrainedOneToOne!=null) { if(pki.suggestedStrategy==null) { idValue.setIdentifierGeneratorStrategy("foreign"); } if(pki.suggestedProperties==null) { defaultStrategyProperties.setProperty("property", constrainedOneToOne.getName()); idValue.setIdentifierGeneratorProperties(defaultStrategyProperties); } } }
@SuppressWarnings("unchecked") public EntityIdentifierCompositeAggregatedImpl( EntityHierarchyImpl runtimeModelHierarchy, RootClass bootModelRootEntity, EmbeddedTypeDescriptor embeddedDescriptor, RuntimeModelCreationContext creationContext) { super( runtimeModelHierarchy.getRootEntityType(), bootModelRootEntity.getIdentifierProperty(), embeddedDescriptor.getRepresentationStrategy().generatePropertyAccess( bootModelRootEntity, bootModelRootEntity.getIdentifierProperty(), (ManagedTypeDescriptor<?>) embeddedDescriptor.getContainer(), creationContext.getSessionFactory().getSessionFactoryOptions().getBytecodeProvider() ), Disposition.ID ); this.embeddedDescriptor = embeddedDescriptor; this.identifierGenerator = creationContext.getSessionFactory().getIdentifierGenerator( bootModelRootEntity.getEntityName() ); final ValueMapping<?> valueMapping = bootModelRootEntity.getIdentifierAttributeMapping().getValueMapping(); this.columns = valueMapping.getMappedColumns().stream() .map( creationContext.getDatabaseObjectResolver()::resolveColumn ) .collect( Collectors.toList() ); }
else if ( rootClass.getIdentifierProperty() != null ) {
else if ( rootClass.getIdentifierProperty() != null ) {