sourceDocument, (SingularAttributeSourceManyToOne) attributeSource, new ManyToOne( sourceDocument, component.getTable() ), component.getComponentClassName() );
if ( value instanceof ManyToOne ) { ManyToOne sourceManyToOne = (ManyToOne) sourceValue; ManyToOne targetManyToOne = new ManyToOne( getBuildingContext(), collection.getCollectionTable() ); targetManyToOne.setFetchMode( FetchMode.DEFAULT ); targetManyToOne.setLazy( true );
mappingDocument, manyToOneAttributeSource, new ManyToOne( mappingDocument, table ), entityDescriptor.getClassName() );
org.hibernate.mapping.Map mapValue = (org.hibernate.mapping.Map) this.collection; if ( isIndexOfEntities ) { element = new ManyToOne( buildingContext, mapValue.getCollectionTable() ); mapValue.setIndex( element ); element.setReferencedEntityName( mapKeyType );
(PersistentClass) persistentClasses.get( ownerEntity ), otherSideProperty, otherSideJoin ); ManyToOne manyToOne = new ManyToOne( buildingContext, mappedByJoin.getTable() );
final PluralAttributeMapKeyManyToManySource mapKeySource = (PluralAttributeMapKeyManyToManySource) pluralAttributeSource.getIndexSource(); final ManyToOne mapKeyBinding = new ManyToOne( mappingDocument, collectionBinding.getCollectionTable()
MetadataBuildingContext context) { org.hibernate.mapping.ManyToOne value = new org.hibernate.mapping.ManyToOne( context, columns[0].getTable() );
@Test public void testProperCallbacks() { final MetadataImplementor metadata = (MetadataImplementor) new MetadataSources( serviceRegistry ) .buildMetadata(); final Table tbl = new Table(); final RootClass rootClass = new RootClass( metadataBuildingContext ); ValueVisitor vv = new ValueVisitorValidator(); MetadataBuildingContextTestingImpl metadataBuildingContext = new MetadataBuildingContextTestingImpl(); new Any( metadataBuildingContext, tbl ).accept( vv ); new Array( metadataBuildingContext, rootClass ).accept( vv ); new Bag( metadataBuildingContext, rootClass ).accept( vv ); new Component( metadataBuildingContext, rootClass ).accept( vv ); new DependantValue( metadataBuildingContext, tbl, null ).accept( vv ); new IdentifierBag( metadataBuildingContext, rootClass ).accept( vv ); new List( metadataBuildingContext, rootClass ).accept( vv ); new ManyToOne( metadataBuildingContext, tbl ).accept( vv ); new Map( metadataBuildingContext, rootClass ).accept( vv ); new OneToMany( metadataBuildingContext, rootClass ).accept( vv ); new OneToOne( metadataBuildingContext, tbl, rootClass ).accept( vv ); new PrimitiveArray( metadataBuildingContext, rootClass ).accept( vv ); new Set( metadataBuildingContext, rootClass ).accept( vv ); new SimpleValue( metadataBuildingContext ).accept( vv ); }
element = new ManyToOne( buildingContext, collValue.getCollectionTable() ); collValue.setElement( element ); element.setReferencedEntityName( collType.getName() );
if ( value instanceof ManyToOne ) { ManyToOne sourceManyToOne = (ManyToOne) sourceValue; ManyToOne targetManyToOne = new ManyToOne( collection.getCollectionTable() ); targetManyToOne.setFetchMode( FetchMode.DEFAULT ); targetManyToOne.setLazy( true );
final PluralAttributeElementSourceManyToMany elementSource = (PluralAttributeElementSourceManyToMany) getPluralAttributeSource().getElementSource(); final ManyToOne elementBinding = new ManyToOne( getMappingDocument(), getCollectionBinding().getCollectionTable()
if ( isCollectionOfEntities ) { element = new ManyToOne( collValue.getCollectionTable() ); collValue.setElement( element ); element.setReferencedEntityName( collType.getName() );
org.hibernate.mapping.Map mapValue = (org.hibernate.mapping.Map) this.collection; if ( isIndexOfEntities ) { element = new ManyToOne( mapValue.getCollectionTable() ); mapValue.setIndex( element ); element.setReferencedEntityName( mapKeyType );
/** * @param mutable * @param table * @param fk * @param columnsToBind * @param processedColumns * @param rc * @param propName */ private Property bindManyToOne(String propertyName, boolean mutable, Table table, ForeignKey fk, Set<Column> processedColumns) { ManyToOne value = new ManyToOne((MetadataImplementor)metadata, table); value.setReferencedEntityName( fk.getReferencedEntityName() ); Iterator<Column> columns = fk.getColumnIterator(); while ( columns.hasNext() ) { Column fkcolumn = (Column) columns.next(); checkColumn(fkcolumn); value.addColumn(fkcolumn); processedColumns.add(fkcolumn); } value.setFetchMode(FetchMode.SELECT); return makeEntityProperty(propertyName, mutable, table, fk, value, false); }
(PersistentClass) persistentClasses.get( ownerEntity ), otherSideProperty, otherSideJoin ); ManyToOne manyToOne = new ManyToOne( mappedByJoin.getTable() );
/** * @param mutable * @param table * @param fk * @param columnsToBind * @param processedColumns * @param rc * @param propName */ private Property bindManyToOne(String propertyName, boolean mutable, Table table, ForeignKey fk, Set<Column> processedColumns) { ManyToOne value = new ManyToOne(mdbc, table); value.setReferencedEntityName( fk.getReferencedEntityName() ); Iterator<Column> columns = fk.getColumnIterator(); while ( columns.hasNext() ) { Column fkcolumn = (Column) columns.next(); checkColumn(fkcolumn); value.addColumn(fkcolumn); processedColumns.add(fkcolumn); } value.setFetchMode(FetchMode.SELECT); return makeEntityProperty(propertyName, mutable, table, fk, value, false); }
) { org.hibernate.mapping.ManyToOne value = new org.hibernate.mapping.ManyToOne( columns[0].getTable() );
LOG.debug("[GrailsDomainBinder] Binding property [" + currentGrailsProp.getName() + "] as ManyToOne"); value = new ManyToOne(mappings, table); bindManyToOne((Association) currentGrailsProp, (ManyToOne) value, path, mappings, sessionFactoryBeanName); } else if (currentGrailsProp instanceof org.grails.datastore.mapping.model.types.OneToOne) { value = new ManyToOne(mappings, table); bindManyToOne((Association) currentGrailsProp, (ManyToOne) value, path, mappings, sessionFactoryBeanName);
LOG.debug("[GrailsDomainBinder] Binding property [" + currentGrailsProp.getName() + "] as ManyToOne"); value = new ManyToOne(mappings, table); bindManyToOne(currentGrailsProp, (ManyToOne) value, path, mappings, sessionFactoryBeanName); } else if (currentGrailsProp.isOneToOne()) { value = new ManyToOne(mappings, table); bindManyToOne(currentGrailsProp, (ManyToOne) value, path, mappings, sessionFactoryBeanName);
element = new ManyToOne(mappings, collection.getCollectionTable()); bindUnidirectionalOneToManyInverseValues(property, (ManyToOne) element);