Hibernate ORM AssertionFailure - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM AssertionFailure class.

This code example shows how to use the following methods:
		return getTable()!=getRootTable();
	} 
 
	public void createForeignKey() { 
		if ( !isJoinedSubclass() ) {
			throw new AssertionFailure( "not a joined-subclass" );
		} 
		getKey().createForeignKeyOfEntity( getSuperclass().getEntityName() );
	} 
 
	public void setEntityPersisterClass(Class classPersisterClass) {
		this.classPersisterClass = classPersisterClass;
	} 
 
	public boolean isLazyPropertiesCacheable() { 
		return getSuperclass().isLazyPropertiesCacheable();
	} 
 
	public int getJoinClosureSpan() { 
		return getSuperclass().getJoinClosureSpan() + super.getJoinClosureSpan();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		this( null ); 
	} 
 
	public ColumnValues(AnnotationInstance columnAnnotation) { 
		if ( columnAnnotation != null && !JPADotNames.COLUMN.equals( columnAnnotation.name() ) ) { 
			throw new AssertionFailure( "A @Column annotation needs to be passed to the constructor" ); 
		} 
		applyColumnValues( columnAnnotation ); 
	} 
 
	private void applyColumnValues(AnnotationInstance columnAnnotation) { 
		// if the column annotation is null we don't have to do anything. Everything is already defaulted. 
		if ( columnAnnotation == null ) { 
			return; 
		} 
 
		AnnotationValue nameValue = columnAnnotation.value( "name" ); 
		if ( nameValue != null ) { 
			this.name = nameValue.asString(); 
		} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		if ( entity == null ) { 
			throw new NullPointerException( "null entities are not supported by " + getClass().getName() );
		} 
		if ( ! entityToOperatedOnFlagMap.containsKey( entity ) ||
			! entityToCopyMap.containsKey( entity ) ) {
			throw new AssertionFailure( "called EventCache.setOperatedOn() for entity not found in EventCache" );
		} 
		entityToOperatedOnFlagMap.put( entity, Boolean.valueOf( isOperatedOn ) );
	} 
 
	/** 
	 * Returns the copy-entity mappings 
	 * @return the copy-entity mappings 
	 */ 
	public IdentityMap invertMap() {
		return IdentityMap.invert( entityToCopyMap );
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	@Override 
	public String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName,
			String referencedColumnName) {
		String header = propertyName != null ? StringHelper.unqualify(propertyName) : propertyTableName;
		if (header == null) {
			throw new AssertionFailure("NamingStrategy not properly filled");
		} 
		return columnName(header); 
	} 
 
	@Override 
	public String logicalColumnName(String columnName, String propertyName) {
		return StringHelper.toUpperCase(StringHelper.isNotEmpty(columnName) ? columnName : StringHelper.unqualify(propertyName));
	} 
 
	@Override 
	public String logicalCollectionTableName(String tableName, String ownerEntityTable, String associatedEntityTable,
			String propertyName) {
		if (tableName != null) {
			return StringHelper.toUpperCase(tableName);
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		return persister.getPropertySpaces();
	} 
 
	@Override 
	public void beforeExecutions() { 
		throw new AssertionFailure( "beforeExecutions() called for non-collection action" );
	} 
 
	@Override 
	public String toString() {
		return StringHelper.unqualify( getClass().getName() ) + MessageHelper.infoString( entityName, id );
	} 
 
	@Override 
	public int compareTo(Object other) { 
		EntityAction action = ( EntityAction ) other;
		//sort first by entity name 
		int roleComparison = entityName.compareTo( action.entityName );
		if ( roleComparison != 0 ) {
			return roleComparison;
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	 * @param persister The entity persister 
	 * @param tenantId The tenant identifier of the session to which this key belongs 
	 */ 
	public EntityKey(Serializable id, EntityPersister persister, String tenantId) {
		if ( id == null ) {
			throw new AssertionFailure( "null identifier" );
		} 
		this.identifier = id; 
		this.rootEntityName = persister.getRootEntityName();
		this.entityName = persister.getEntityName();
		this.tenantId = tenantId;
 
		this.identifierType = persister.getIdentifierType();
		this.isBatchLoadable = persister.isBatchLoadable();
		this.factory = persister.getFactory();
		this.hashCode = generateHashCode();
	} 
 
	/** 
	 * Used to reconstruct an EntityKey during deserialization. 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	 */ 
	public String foreignKeyColumnName(
			String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName
	) { 
		String header = propertyName != null ? StringHelper.unqualify( propertyName ) : propertyTableName;
		if (header == null) throw new AssertionFailure("NammingStrategy not properly filled");
		return columnName( header ); //+ "_" + referencedColumnName not used for backward compatibility
	} 
 
	/** 
	 * Return the column name or the unqualified property name 
	 */ 
	public String logicalColumnName(String columnName, String propertyName) {
		return StringHelper.isNotEmpty( columnName ) ? columnName : StringHelper.unqualify( propertyName );
	} 
 
	/** 
	 * Returns either the table name if explicit or 
	 * if there is an associated table, the concatenation of owner entity table and associated table 
	 * otherwise the concatenation of owner entity table and the unqualified property name 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public EmbeddedCacheManager getCacheManager(final int expectedGroupSize) {
		if ( ! started ) {
			throw new IllegalStateException( "The before() method of this Rule was not triggered (or did not complete succesfully)" );
		} 
		if ( manager == null ) {
			throw new AssertionFailure( "Unexpected state: the CacheManager not created?" );
		} 
		if ( ! groupFormed && expectedGroupSize != 1 ) {
			verifyNetworkStackEnabled(); 
			verifyConfiguredAsClustered( manager );
			TestingUtil.blockUntilViewReceived( manager.getCache(), expectedGroupSize, joinTimeoutMilliseconds, true );
		} 
		return manager;
	} 
 
	public static void verifyNetworkStackEnabled() { 
		Assert.assertEquals( "Environment property '-Djgroups.bind_addr=127.0.0.1' was not detected", "127.0.0.1", JGROUPS_HOSTNAME );
		Assert.assertTrue( "Environment property '-Djava.net.preferIPv4Stack=true' was not detected", IPV4_STACK.booleanValue() );
	} 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		return collection.getOwner().getEntityName(); 
	} 
 
	public void addProperty(Property prop, Ejb3Column[] columns, XClass declaringClass) { 
		//Ejb3Column.checkPropertyConsistency( ); //already called earlier 
		throw new AssertionFailure( "addProperty to a join table of a collection: does it make sense?" ); 
	} 
 
	public Join addJoin(JoinTable joinTableAnn, boolean noDelayInPkColumnCreation) { 
		throw new AssertionFailure( "Add a <join> in a second pass" ); 
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
import org.hibernate.metamodel.source.binder.RootEntitySource; 
import org.hibernate.metamodel.source.binder.SingularAttributeSource; 
 
/** 
 * @author Hardy Ferentschik 
 */ 
public class RootEntitySourceImpl extends EntitySourceImpl implements RootEntitySource { 
	public RootEntitySourceImpl(EntityClass entityClass) {
		super( entityClass );
	} 
 
	@Override 
	public IdentifierSource getIdentifierSource() { 
		IdType idType = getEntityClass().getIdType();
		switch ( idType ) {
			case SIMPLE: {
				BasicAttribute attribute = getEntityClass().getIdAttributes().iterator().next();
				return new SimpleIdentifierSourceImpl( attribute, getEntityClass().getAttributeOverrideMap() );
			} 
			case COMPOSED: {
4
CodeRank
Experience pair programming with AI  Get Codota for Java