Package org.hibernate

Examples of org.hibernate.NaturalIdLoadAccess


    if ( naturalIdentifierProperties.length != naturalIdValues.size() ) {
      return null;
    }

    final String[] propertyNames = entityPersister.getPropertyNames();
    final NaturalIdLoadAccess naturalIdLoader = this.byNaturalId( entityName );

    // Build NaturalIdLoadAccess and in the process verify all naturalId properties were specified
    for ( int i = 0; i < naturalIdentifierProperties.length; i++ ) {
      final String naturalIdProperty = propertyNames[naturalIdentifierProperties[i]];
      final Object naturalIdValue = naturalIdValues.get( naturalIdProperty );

      if ( naturalIdValue == null ) {
        // A NaturalId property is missing from the critera query, can't use NaturalIdLoadAccess
        return null;
      }

      naturalIdLoader.using( naturalIdProperty, naturalIdValue );
    }

    // Critera query contains a valid naturalId, use the new API
    LOG.warn( "Session.byNaturalId(" + entityName
        + ") should be used for naturalId queries instead of Restrictions.naturalId() from a Criteria" );
View Full Code Here


  public List list(Criteria criteria) throws HibernateException {
    // TODO: Is this guaranteed to always be CriteriaImpl?
    CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
       
    final NaturalIdLoadAccess naturalIdLoadAccess = this.tryNaturalIdLoadAccess( criteriaImpl );
    if ( naturalIdLoadAccess != null ) {
      // EARLY EXIT!
      return Arrays.asList( naturalIdLoadAccess.load() );
    }

    errorIfClosed();
    checkTransactionSynchStatus();
    String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );
View Full Code Here

    if ( naturalIdentifierProperties.length != naturalIdValues.size() ) {
      return null;
    }

    final String[] propertyNames = entityPersister.getPropertyNames();
    final NaturalIdLoadAccess naturalIdLoader = this.byNaturalId( entityName );

    // Build NaturalIdLoadAccess and in the process verify all naturalId properties were specified
    for ( int i = 0; i < naturalIdentifierProperties.length; i++ ) {
      final String naturalIdProperty = propertyNames[naturalIdentifierProperties[i]];
      final Object naturalIdValue = naturalIdValues.get( naturalIdProperty );

      if ( naturalIdValue == null ) {
        // A NaturalId property is missing from the critera query, can't use NaturalIdLoadAccess
        return null;
      }

      naturalIdLoader.using( naturalIdProperty, naturalIdValue );
    }

    // Critera query contains a valid naturalId, use the new API
    LOG.warn( "Session.byNaturalId(" + entityName
        + ") should be used for naturalId queries instead of Restrictions.naturalId() from a Criteria" );
View Full Code Here

  public List list(Criteria criteria) throws HibernateException {
    // TODO: Is this guaranteed to always be CriteriaImpl?
    CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
       
    final NaturalIdLoadAccess naturalIdLoadAccess = this.tryNaturalIdLoadAccess( criteriaImpl );
    if ( naturalIdLoadAccess != null ) {
      // EARLY EXIT!
      return Arrays.asList( naturalIdLoadAccess.load() );
    }

    errorIfClosed();
    checkTransactionSynchStatus();
    String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );
View Full Code Here

    if ( naturalIdentifierProperties.length != naturalIdValues.size() ) {
      return null;
    }

    final String[] propertyNames = entityPersister.getPropertyNames();
    final NaturalIdLoadAccess naturalIdLoader = this.byNaturalId( entityName );

    // Build NaturalIdLoadAccess and in the process verify all naturalId properties were specified
    for ( int i = 0; i < naturalIdentifierProperties.length; i++ ) {
      final String naturalIdProperty = propertyNames[naturalIdentifierProperties[i]];
      final Object naturalIdValue = naturalIdValues.get( naturalIdProperty );

      if ( naturalIdValue == null ) {
        // A NaturalId property is missing from the critera query, can't use NaturalIdLoadAccess
        return null;
      }

      naturalIdLoader.using( naturalIdProperty, naturalIdValue );
    }

    // Critera query contains a valid naturalId, use the new API
    LOG.warn( "Session.byNaturalId(" + entityName
        + ") should be used for naturalId queries instead of Restrictions.naturalId() from a Criteria" );
View Full Code Here

      dontFlushFromFind--;
    }
  }

  public List list(CriteriaImpl criteria) throws HibernateException {
    final NaturalIdLoadAccess naturalIdLoadAccess = this.tryNaturalIdLoadAccess( criteria );
    if ( naturalIdLoadAccess != null ) {
      // EARLY EXIT!
      return Arrays.asList( naturalIdLoadAccess.load() );
    }

    errorIfClosed();
    checkTransactionSynchStatus();
    String[] implementors = factory.getImplementors( criteria.getEntityOrClassName() );
View Full Code Here

    if ( naturalIdentifierProperties.length != naturalIdValues.size() ) {
      return null;
    }

    final String[] propertyNames = entityPersister.getPropertyNames();
    final NaturalIdLoadAccess naturalIdLoader = this.byNaturalId( entityName );

    // Build NaturalIdLoadAccess and in the process verify all naturalId properties were specified
    for ( int i = 0; i < naturalIdentifierProperties.length; i++ ) {
      final String naturalIdProperty = propertyNames[naturalIdentifierProperties[i]];
      final Object naturalIdValue = naturalIdValues.get( naturalIdProperty );

      if ( naturalIdValue == null ) {
        // A NaturalId property is missing from the critera query, can't use NaturalIdLoadAccess
        return null;
      }

      naturalIdLoader.using( naturalIdProperty, naturalIdValue );
    }

    // Critera query contains a valid naturalId, use the new API
    LOG.warn( "Session.byNaturalId(" + entityName
        + ") should be used for naturalId queries instead of Restrictions.naturalId() from a Criteria" );
View Full Code Here

  public List list(Criteria criteria) throws HibernateException {
    // TODO: Is this guaranteed to always be CriteriaImpl?
    CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
       
    final NaturalIdLoadAccess naturalIdLoadAccess = this.tryNaturalIdLoadAccess( criteriaImpl );
    if ( naturalIdLoadAccess != null ) {
      // EARLY EXIT!
      return Arrays.asList( naturalIdLoadAccess.load() );
    }

    errorIfClosed();
    checkTransactionSynchStatus();
    String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );
View Full Code Here

    if ( naturalIdentifierProperties.length != naturalIdValues.size() ) {
      return null;
    }

    final String[] propertyNames = entityPersister.getPropertyNames();
    final NaturalIdLoadAccess naturalIdLoader = this.byNaturalId( entityName );

    // Build NaturalIdLoadAccess and in the process verify all naturalId properties were specified
    for ( int i = 0; i < naturalIdentifierProperties.length; i++ ) {
      final String naturalIdProperty = propertyNames[naturalIdentifierProperties[i]];
      final Object naturalIdValue = naturalIdValues.get( naturalIdProperty );

      if ( naturalIdValue == null ) {
        // A NaturalId property is missing from the critera query, can't use NaturalIdLoadAccess
        return null;
      }

      naturalIdLoader.using( naturalIdProperty, naturalIdValue );
    }

    // Critera query contains a valid naturalId, use the new API
    LOG.warn( "Session.byNaturalId(" + entityName
        + ") should be used for naturalId queries instead of Restrictions.naturalId() from a Criteria" );
View Full Code Here

  public List list(Criteria criteria) throws HibernateException {
    // TODO: Is this guaranteed to always be CriteriaImpl?
    CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
       
    final NaturalIdLoadAccess naturalIdLoadAccess = this.tryNaturalIdLoadAccess( criteriaImpl );
    if ( naturalIdLoadAccess != null ) {
      // EARLY EXIT!
      return Arrays.asList( naturalIdLoadAccess.load() );
    }

    errorIfClosed();
    checkTransactionSynchStatus();
    String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );
View Full Code Here

TOP

Related Classes of org.hibernate.NaturalIdLoadAccess

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.