Examples of ManyToOne


Examples of org.hibernate.mapping.ManyToOne

          );
        mappings.addCollection( collection );
        value = collection;
      }
      else if ( "many-to-one".equals( name ) ) {
        value = new ManyToOne( table );
        bindManyToOne( subnode, (ManyToOne) value, propertyName, nullable, mappings );
      }
      else if ( "any".equals( name ) ) {
        value = new Any( table );
        bindAny( subnode, (Any) value, nullable, mappings );
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

        }
        map.setIndex( value );
        map.setIndexNodeName( subnode.attributeValue("node") );
      }
      else if ( "index-many-to-many".equals( name ) || "map-key-many-to-many".equals( name ) ) {
        ManyToOne mto = new ManyToOne( map.getCollectionTable() );
        bindManyToOne(
            subnode,
            mto,
            IndexedCollection.DEFAULT_INDEX_COLUMN_NAME,
            map.isOneToMany(),
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

            Collection.DEFAULT_ELEMENT_COLUMN_NAME,
            mappings
          );
      }
      else if ( "many-to-many".equals( name ) ) {
        ManyToOne element = new ManyToOne( collection.getCollectionTable() );
        collection.setElement( element );
        bindManyToOne(
            subnode,
            element,
            Collection.DEFAULT_ELEMENT_COLUMN_NAME,
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

      String name = subnode.getName();
      String propertyName = subnode.attributeValue( "name" );

      Value value = null;
      if ( "many-to-one".equals( name ) ) {
        value = new ManyToOne( table );
        bindManyToOne( subnode, (ManyToOne) value, propertyName, true, mappings );
      }
      else if ( "any".equals( name ) ) {
        value = new Any( table );
        bindAny( subnode, (Any) value, true, mappings );
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

          );
        mappings.addCollection( collection );
        value = collection;
      }
      else if ( "many-to-one".equals( name ) || "key-many-to-one".equals( name ) ) {
        value = new ManyToOne( component.getTable() );
        String relativePath;
        if (isEmbedded) {
          relativePath = propertyName;
        }
        else {
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

          );
        mappings.addCollection( collection );
        value = collection;
      }
      else if ( "many-to-one".equals( name ) ) {
        value = new ManyToOne( table );
        bindManyToOne( subnode, (ManyToOne) value, propertyName, nullable, mappings );
      }
      else if ( "any".equals( name ) ) {
        value = new Any( table );
        bindAny( subnode, (Any) value, nullable, mappings );
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

        }
        map.setIndex( value );
        map.setIndexNodeName( subnode.attributeValue("node") );
      }
      else if ( "index-many-to-many".equals( name ) || "map-key-many-to-many".equals( name ) ) {
        ManyToOne mto = new ManyToOne( map.getCollectionTable() );
        bindManyToOne(
            subnode,
            mto,
            IndexedCollection.DEFAULT_INDEX_COLUMN_NAME,
            map.isOneToMany(),
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

            Collection.DEFAULT_ELEMENT_COLUMN_NAME,
            mappings
          );
      }
      else if ( "many-to-many".equals( name ) ) {
        ManyToOne element = new ManyToOne( collection.getCollectionTable() );
        collection.setElement( element );
        bindManyToOne(
            subnode,
            element,
            Collection.DEFAULT_ELEMENT_COLUMN_NAME,
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

        if (collectionValue.getElement() instanceof OneToMany) {
            OneToMany oneToManyValue = (OneToMany) collectionValue.getElement();
            referencedClass = oneToManyValue.getAssociatedClass();
        } else if (collectionValue.getElement() instanceof ManyToOne) {
            // Case for bi-directional relation with @JoinTable on the owning @ManyToOne side.
            ManyToOne manyToOneValue = (ManyToOne) collectionValue.getElement();
            referencedClass = manyToOneValue.getMappings().getClass(manyToOneValue.getReferencedEntityName());
        }

        // If there's an @AuditMappedBy specified, returning it directly.
        String auditMappedBy = propertyAuditingData.getAuditMappedBy();
        if (auditMappedBy != null) {
View Full Code Here

Examples of org.hibernate.mapping.ManyToOne

      collValue.setCollectionTable( associationTableBinder.bind() );
    }
    bindFilters( isCollectionOfEntities );
    bindCollectionSecondPass( collValue, collectionEntity, joinColumns, cascadeDeleteEnabled, property, mappings );

    ManyToOne element = null;
    if ( isCollectionOfEntities ) {
      element =
          new ManyToOne( mappings,  collValue.getCollectionTable() );
      collValue.setElement( element );
      element.setReferencedEntityName( collType.getName() );
      //element.setFetchMode( fetchMode );
      //element.setLazy( fetchMode != FetchMode.JOIN );
      //make the second join non lazy
      element.setFetchMode( FetchMode.JOIN );
      element.setLazy( false );
      element.setIgnoreNotFound( ignoreNotFound );
      // as per 11.1.38 of JPA 2.0 spec, default to primary key if no column is specified by @OrderBy.
      if ( hqlOrderBy != null ) {
        collValue.setManyToManyOrdering(
            buildOrderByClauseFromHql( hqlOrderBy, collectionEntity, collValue.getRole() )
        );
      }
      final ForeignKey fk = property.getAnnotation( ForeignKey.class );
      String fkName = fk != null ? fk.inverseName() : "";
      if ( !BinderHelper.isEmptyAnnotationValue( fkName ) ) {
        element.setForeignKeyName( fkName );
      }
    }
    else if ( anyAnn != null ) {
      //@ManyToAny
      //Make sure that collTyp is never used during the @ManyToAny branch: it will be set to void.class
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.