protected Collection createCollection(PersistentClass persistentClass) { return new org.hibernate.mapping.Map( getBuildingContext(), persistentClass ); }
Component component = (Component) value; Iterator properties = component.getPropertyIterator(); Component indexComponent = new Component( getBuildingContext(), collection ); indexComponent.setComponentClassName( component.getComponentClassName() ); while ( properties.hasNext() ) { if ( value instanceof ManyToOne ) { ManyToOne sourceManyToOne = (ManyToOne) sourceValue; ManyToOne targetManyToOne = new ManyToOne( getBuildingContext(), collection.getCollectionTable() ); targetManyToOne.setFetchMode( FetchMode.DEFAULT ); targetManyToOne.setLazy( true ); targetValue = new SimpleValue( getBuildingContext(), collection.getCollectionTable() ); targetValue.copyTypeFrom( sourceValue );
protected Collection createCollection(PersistentClass persistentClass) { return new org.hibernate.mapping.Map( getBuildingContext(), persistentClass ); }
List<PersistentAttributeMapping> attributes = component.getDeclaredPersistentAttributes(); Component indexComponent = new Component( getBuildingContext(), collection ); indexComponent.setComponentClassName( component.getEmbeddableClassName() ); attributes.stream() .map( Property.class::cast ) .forEach( current -> { Property newProperty = new Property( getBuildingContext() ); newProperty.setCascade( current.getCascade() ); newProperty.setValueGenerationStrategy( current.getValueGenerationStrategy() ); if ( value instanceof ManyToOne ) { final ManyToOne sourceManyToOne = (ManyToOne) sourceValue; final ManyToOne targetManyToOne = new ManyToOne( getBuildingContext(), collection.getMappedTable() ); targetManyToOne.setFetchMode( FetchMode.DEFAULT ); targetManyToOne.setLazy( true ); targetValue = new BasicValue( getBuildingContext(), collection.getMappedTable() ); targetValue.copyTypeFrom( sourceValue );