Package org.hibernate.jpa.graph.internal

Examples of org.hibernate.jpa.graph.internal.EntityGraphImpl


      throw new IllegalArgumentException(
          "Unknown type of EntityGraph for making named : " + entityGraph.getClass().getName()
      );
    }
    final EntityGraphImpl<T> copy = ( (EntityGraphImpl<T>) entityGraph ).makeImmutableCopy( graphName );
    final EntityGraphImpl old = entityGraphs.put( graphName, copy );
    if ( old != null ) {
      log.debugf( "EntityGraph being replaced on EntityManagerFactory for name %s", graphName );
    }
  }
View Full Code Here


  }

  @Override
  public EntityGraph<?> createEntityGraph(String graphName) {
    checkOpen();
    final EntityGraphImpl named = getEntityManagerFactory().findEntityGraphByName( graphName );
    if ( named == null ) {
      return null;
    }
    return named.makeMutableCopy();
  }
View Full Code Here

  @Override
  @SuppressWarnings("unchecked")
  public <T> EntityGraph<T> getEntityGraph(String graphName) {
    checkOpen();
    final EntityGraphImpl named = getEntityManagerFactory().findEntityGraphByName( graphName );
    if ( named == null ) {
      throw new IllegalArgumentException( "Could not locate EntityGraph with given name : " + graphName );
    }
    return named;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  private void applyNamedEntityGraphs(Collection<NamedEntityGraphDefinition> namedEntityGraphs) {
    for ( NamedEntityGraphDefinition definition : namedEntityGraphs ) {
      final EntityType entityType = metamodel.getEntityTypeByName( definition.getJpaEntityName() );
      final EntityGraphImpl entityGraph = new EntityGraphImpl(
          definition.getRegisteredName(),
          entityType,
          this
      );

      final NamedEntityGraph namedEntityGraph = definition.getAnnotation();

      if ( namedEntityGraph.includeAllAttributes() ) {
        for ( Object attributeObject : entityType.getAttributes() ) {
          entityGraph.addAttributeNodes( (Attribute) attributeObject );
        }
      }

      if ( namedEntityGraph.attributeNodes() != null ) {
        applyNamedAttributeNodes( namedEntityGraph.attributeNodes(), namedEntityGraph, entityGraph );
View Full Code Here

      throw new IllegalArgumentException(
          "Unknown type of EntityGraph for making named : " + entityGraph.getClass().getName()
      );
    }
    final EntityGraphImpl<T> copy = ( (EntityGraphImpl<T>) entityGraph ).makeImmutableCopy( graphName );
    final EntityGraphImpl old = entityGraphs.put( graphName, copy );
    if ( old != null ) {
      log.debugf( "EntityGraph being replaced on EntityManagerFactory for name %s", graphName );
    }
  }
View Full Code Here

  }

  @Override
  public EntityGraph<?> createEntityGraph(String graphName) {
    checkOpen();
    final EntityGraphImpl named = getEntityManagerFactory().findEntityGraphByName( graphName );
    if ( named == null ) {
      return null;
    }
    return named.makeMutableCopy();
  }
View Full Code Here

  @Override
  @SuppressWarnings("unchecked")
  public EntityGraph<?> getEntityGraph(String graphName) {
    checkOpen();
    final EntityGraphImpl named = getEntityManagerFactory().findEntityGraphByName( graphName );
    if ( named == null ) {
      throw new IllegalArgumentException( "Could not locate EntityGraph with given name : " + graphName );
    }
    return named;
  }
View Full Code Here

            "Attempted to register named entity graph [" + definition.getRegisteredName()
                + "] for unknown entity ["+ definition.getEntityName() + "]"

        );
      }
      final EntityGraphImpl entityGraph = new EntityGraphImpl(
          definition.getRegisteredName(),
          entityType,
          this
      );

      final NamedEntityGraph namedEntityGraph = definition.getAnnotation();

      if ( namedEntityGraph.includeAllAttributes() ) {
        for ( Object attributeObject : entityType.getAttributes() ) {
          entityGraph.addAttributeNodes( (Attribute) attributeObject );
        }
      }

      if ( namedEntityGraph.attributeNodes() != null ) {
        applyNamedAttributeNodes( namedEntityGraph.attributeNodes(), namedEntityGraph, entityGraph );
View Full Code Here

      throw new IllegalArgumentException(
          "Unknown type of EntityGraph for making named : " + entityGraph.getClass().getName()
      );
    }
    final EntityGraphImpl<T> copy = ( (EntityGraphImpl<T>) entityGraph ).makeImmutableCopy( graphName );
    final EntityGraphImpl old = entityGraphs.put( graphName, copy );
    if ( old != null ) {
      log.debugf( "EntityGraph being replaced on EntityManagerFactory for name %s", graphName );
    }
  }
View Full Code Here

            "Attempted to register named entity graph [" + definition.getRegisteredName()
                + "] for unknown entity ["+ definition.getEntityName() + "]"

        );
      }
      final EntityGraphImpl entityGraph = new EntityGraphImpl(
          definition.getRegisteredName(),
          entityType,
          this
      );

      final NamedEntityGraph namedEntityGraph = definition.getAnnotation();

      if ( namedEntityGraph.includeAllAttributes() ) {
        for ( Object attributeObject : entityType.getAttributes() ) {
          entityGraph.addAttributeNodes( (Attribute) attributeObject );
        }
      }

      if ( namedEntityGraph.attributeNodes() != null ) {
        applyNamedAttributeNodes( namedEntityGraph.attributeNodes(), namedEntityGraph, entityGraph );
View Full Code Here

TOP

Related Classes of org.hibernate.jpa.graph.internal.EntityGraphImpl

Copyright © 2018 www.massapicom. 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.