Package org.hibernate

Examples of org.hibernate.AssertionFailure


  }

  @Override
  public String getSubclassTableName(int j) {
    if ( j != 0 ) {
      throw new AssertionFailure( "only one table" );
    }
    return tableName;
  }
View Full Code Here


  }

  @Override
  protected String[] getSubclassTableKeyColumns(int j) {
    if ( j != 0 ) {
      throw new AssertionFailure( "only one table" );
    }
    return getIdentifierColumnNames();
  }
View Full Code Here

  }

  @Override
  protected boolean isClassOrSuperclassTable(int j) {
    if ( j != 0 ) {
      throw new AssertionFailure( "only one table" );
    }
    return true;
  }
View Full Code Here

  }

  @Override
  public void processInsertGeneratedProperties(Serializable id, Object entity, Object[] state, SessionImplementor session) {
    if ( !hasUpdateGeneratedProperties() ) {
      throw new AssertionFailure("no insert-generated properties");
    }
    processGeneratedProperties( id, entity, state, session, GenerationTiming.INSERT );
  }
View Full Code Here

  }

  @Override
  public void processUpdateGeneratedProperties(Serializable id, Object entity, Object[] state, SessionImplementor session) {
    if ( !hasUpdateGeneratedProperties() ) {
      throw new AssertionFailure("no update-generated properties");
    }
    processGeneratedProperties( id, entity, state, session, GenerationTiming.ALWAYS );
  }
View Full Code Here

    else if ( namedQueryDefinition.getResultSetRef() != null ) {
      final ResultSetMappingDefinition rsMapping = sfi.getResultSetMapping( namedQueryDefinition.getResultSetRef() );
      queryReturns = rsMapping.getQueryReturns();
    }
    else {
      throw new AssertionFailure( "Unsupported named query model. Please report the bug in Hibernate EntityManager");
    }

    if ( queryReturns.length > 1 ) {
      throw new IllegalArgumentException( "Cannot create TypedQuery for query with more than one return" );
    }

    final NativeSQLQueryReturn nativeSQLQueryReturn = queryReturns[0];

    if ( nativeSQLQueryReturn instanceof NativeSQLQueryRootReturn ) {
      final Class<?> actualReturnedClass;
      final String entityClassName = ( (NativeSQLQueryRootReturn) nativeSQLQueryReturn ).getReturnEntityName();
      try {
        actualReturnedClass = sfi.getServiceRegistry().getService( ClassLoaderService.class ).classForName( entityClassName );
      }
      catch ( ClassLoadingException e ) {
        throw new AssertionFailure(
            "Unable to load class [" + entityClassName + "] declared on named native query [" +
                namedQueryDefinition.getName() + "]"
        );
      }
      if ( !resultType.isAssignableFrom( actualReturnedClass ) ) {
View Full Code Here

  public String foreignKeyColumnName(
      String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName
  ) {
    String header = propertyName != null ? replacePropertySeparator( propertyName ) : propertyTableName;
    if ( header == null ) {
      throw new AssertionFailure( "NamingStrategy not properly filled" );
    }
    return columnName( header + "_" + referencedColumnName );
  }
View Full Code Here

      // We have found a temporary node related to this association, we are going to delete it and connect the
      // entity pointing to the temporary node and the owner of this association.
      return deleteTempNodeAndUpdateRelationshipWithEntity( associationKey, rowKey, rowKeyNode );
    }
    else {
      throw new AssertionFailure( "Unrecognized row key node: " + rowKeyNode );
    }
  }
View Full Code Here

      // We have found a temporary node related to this association, we are going to delete it and connect the
      // entity pointing to the temporary node and the owner of this association.
      return deleteTempNodeAndCreateRelationshipWithEntity( associationKey, rowKey, rowKeyNode );
    }
    else {
      throw new AssertionFailure( "Unrecognized row key node: " + rowKeyNode );
    }
  }
View Full Code Here

        rs.close();
      }
    }

    public Serializable determineGeneratedIdentifier(SessionImplementor session, Object entity) {
      throw new AssertionFailure( "insert statement returns generated value" );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.AssertionFailure

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.