throws HibernateException, SQLException { if ( !persister.isInstance( object ) ) { throw new WrongClassException( "loaded object was of wrong class " + object.getClass(), key.getIdentifier(),
throw new WrongClassException( "Discriminator: " + discriminatorValue, id,
throw new WrongClassException( "loaded object was of wrong class " + entity.getClass(), event.getEntityId(),
throw new WrongClassException( "Discriminator: " + discriminatorValue, entityKey.getIdentifier(),
throw new WrongClassException( "loaded object was of wrong class " + existing.getClass(), entityKey.getIdentifier(),
throw new WrongClassException( "class of the given object did not match class of persistent copy", event.getRequestedId(),
throw new WrongClassException( "Discriminator: " + discriminatorValue, id,
throw new WrongClassException( "Discriminator: " + discriminatorValue, id,
throw new WrongClassException( "Discriminator: " + discriminatorValue, id,
throw new WrongClassException( "Discriminator: " + discriminatorValue, id,
throw new WrongClassException( "loaded object was of wrong class " + entity.getClass(), event.getEntityId(),
private EntityTypeDescriptor determineConcreteEntityDescriptor( RowProcessingState rowProcessingState, SharedSessionContractImplementor persistenceContext) throws WrongClassException { if ( discriminatorAssembler == null ) { return entityDescriptor; } final Object discriminatorValue = discriminatorAssembler.assemble( rowProcessingState, rowProcessingState.getJdbcValuesSourceProcessingState().getProcessingOptions() ); final String result = entityDescriptor.getHierarchy() .getDiscriminatorDescriptor() .getDiscriminatorMappings() .discriminatorValueToEntityName( discriminatorValue ); if ( result == null ) { // oops - we got an instance of another class hierarchy branch throw new WrongClassException( "Discriminator: " + discriminatorValue, entityKey.getIdentifier(), entityDescriptor.getEntityName() ); } return persistenceContext.getFactory().getMetamodel().findEntityDescriptor( result ); }
throws HibernateException, SQLException { if ( !persister.isInstance( object ) ) { throw new WrongClassException( "loaded object was of wrong class " + object.getClass(), key.getIdentifier(),
throws HibernateException, SQLException { if ( !persister.isInstance( object ) ) { throw new WrongClassException( "loaded object was of wrong class " + object.getClass(), key.getIdentifier(),
throw new WrongClassException( "loaded object was of wrong class " + object.getClass(), key.getIdentifier(),
throws HibernateException { if ( !persister.isInstance( object ) ) { throw new WrongClassException( "loaded object was of wrong class " + object.getClass(), key.getIdentifier(),
/** * The entity instance is already in the session cache */ private void instanceAlreadyLoaded(final ResultSet rs, final int i, final Loadable persister, final EntityKey key, final Object object, final LockMode lockMode, final SessionImplementor session) throws HibernateException, SQLException { if ( !persister.isInstance( object, session.getEntityMode() ) ) { throw new WrongClassException( "loaded object was of wrong class", key.getIdentifier(), persister.getEntityName() ); } if ( LockMode.NONE != lockMode && upgradeLocks() ) { //no point doing this if NONE was requested final boolean isVersionCheckNeeded = persister.isVersioned() && session.getPersistenceContext().getLockMode( object ).lessThan( lockMode ); // we don't need to worry about existing version being uninitialized // because this block isn't called by a re-entrant load (re-entrant // loads _always_ have lock mode NONE) if (isVersionCheckNeeded) { //we only check the version when _upgrading_ lock modes checkVersion( i, persister, key.getIdentifier(), object, rs, session ); //we need to upgrade the lock mode to the mode requested session.getPersistenceContext().setLockMode( object, lockMode ); } } }
throw new WrongClassException( "class of the given object did not match class of persistent copy", event.getRequestedId(),
throw new WrongClassException( "class of the given object did not match class of persistent copy", event.getRequestedId(),
throw new WrongClassException( "class of the given object did not match class of persistent copy", event.getRequestedId(),