@Override public JpaCompliance getJpaCompliance() { return delegate.getJpaCompliance(); }
/** * @deprecated Use {@link JpaCompliance#isJpaQueryComplianceEnabled()} instead * via {@link #getJpaCompliance()} */ @Deprecated default boolean isStrictJpaQueryLanguageCompliance() { return getJpaCompliance().isJpaQueryComplianceEnabled(); }
public boolean isStrictJPAQLComplianceEnabled() { return sfi.getSessionFactoryOptions().getJpaCompliance().isJpaQueryComplianceEnabled(); } }
private boolean isInitializeProxyWhenAccessingIdentifier() { return session != null && session.getFactory() .getSessionFactoryOptions() .getJpaCompliance().isJpaProxyComplianceEnabled(); }
@Override public String render(RenderingContext renderingContext) { if ( criteriaBuilder().getEntityManagerFactory().getSessionFactoryOptions().getJpaCompliance() .isJpaQueryComplianceEnabled() && renderingContext.getClauseStack().getCurrent() == Clause.SELECT ) { throw new IllegalStateException( "The JPA specification does not support subqueries in select clauses. " + "Please disable the JPA query compliance if you want to use this feature." ); } StringBuilder subqueryBuffer = new StringBuilder( "(" ); queryStructure.render( subqueryBuffer, renderingContext ); subqueryBuffer.append( ')' ); return subqueryBuffer.toString(); } }
/** * Construct a ResourceLocalTransactionCoordinatorImpl instance. package-protected to ensure access goes through * builder. * * @param owner The transactionCoordinatorOwner */ JdbcResourceLocalTransactionCoordinatorImpl( TransactionCoordinatorBuilder transactionCoordinatorBuilder, TransactionCoordinatorOwner owner, JdbcResourceTransactionAccess jdbcResourceTransactionAccess) { this.observers = new ArrayList<>(); this.transactionCoordinatorBuilder = transactionCoordinatorBuilder; this.jdbcResourceTransactionAccess = jdbcResourceTransactionAccess; this.transactionCoordinatorOwner = owner; this.jpaCompliance = owner.getJdbcSessionOwner() .getJdbcSessionContext() .getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance(); }
@Override public JpaCompliance getJpaCompliance() { return transactionCoordinatorOwner.getJdbcSessionOwner() .getJdbcSessionContext() .getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance(); }
@Override @SuppressWarnings("StatementWithEmptyBody") public void close() throws HibernateException { if ( isClosed() ) { if ( getFactory().getSessionFactoryOptions().getJpaCompliance().isJpaClosedComplianceEnabled() ) { throw new IllegalStateException( "Illegal call to #close() on already closed Session/EntityManager" ); } log.trace( "Already closed" ); return; } closeWithoutOpenChecks(); }
@Override public Transaction getTransaction() throws HibernateException { if ( getFactory().getSessionFactoryOptions().getJpaCompliance().isJpaTransactionComplianceEnabled() ) { // JPA requires that we throw IllegalStateException if this is called // on a JTA EntityManager if ( getTransactionCoordinator().getTransactionCoordinatorBuilder().isJta() ) { if ( !getFactory().getSessionFactoryOptions().isJtaTransactionAccessEnabled() ) { throw new IllegalStateException( "A JTA EntityManager cannot use getTransaction()" ); } } } return accessTransaction(); }
public TransactionImpl( TransactionCoordinator transactionCoordinator, ExceptionConverter exceptionConverter, AbstractSharedSessionContract session) { this.transactionCoordinator = transactionCoordinator; this.exceptionConverter = exceptionConverter; this.jpaCompliance = session.getFactory().getSessionFactoryOptions().getJpaCompliance(); this.session = session; if ( session.isOpen() && transactionCoordinator.isActive() ) { this.transactionDriverControl = transactionCoordinator.getTransactionDriverControl(); } else { LOG.debug( "TransactionImpl created on closed Session/EntityManager" ); } if ( LOG.isDebugEnabled() ) { LOG.debugf( "On TransactionImpl creation, JpaCompliance#isJpaTransactionComplianceEnabled == %s", jpaCompliance.isJpaTransactionComplianceEnabled() ); } }
.getJpaCompliance() .isJpaCacheComplianceEnabled(); if ( complianceEnabled ) {
creationContext.getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance() .isJpaCacheComplianceEnabled(); isInverseTable[tableIndex] = join.isInverse(); join.isOptional() || creationContext.getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance() .isJpaCacheComplianceEnabled() ); || creationContext.getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance() .isJpaCacheComplianceEnabled();
|| creationContext.getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance() .isJpaCacheComplianceEnabled(); cascadeDeleteEnabled[j] = join.getKey().isCascadeDeleteEnabled() && join.isOptional() || creationContext.getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance() .isJpaCacheComplianceEnabled() );
synchronized (this) { if ( isClosed ) { if ( getSessionFactoryOptions().getJpaCompliance().isJpaClosedComplianceEnabled() ) { throw new IllegalStateException( "EntityManagerFactory is already closed" );
LOG.debugf( "Generate SQL with comments: %s", enabledDisabled( sessionFactoryOptions.isCommentsEnabled() ) ); LOG.debugf( "JPA compliance - query : ", enabledDisabled( sessionFactoryOptions.getJpaCompliance().isJpaQueryComplianceEnabled() ) ); LOG.debugf( "JPA compliance - closed-handling : ", enabledDisabled( sessionFactoryOptions.getJpaCompliance().isJpaClosedComplianceEnabled() ) ); LOG.debugf( "JPA compliance - lists : ", enabledDisabled( sessionFactoryOptions.getJpaCompliance().isJpaListComplianceEnabled() ) ); LOG.debugf( "JPA compliance - transactions : ", enabledDisabled( sessionFactoryOptions.getJpaCompliance().isJpaTransactionComplianceEnabled() ) );
/** * @deprecated Use {@link JpaCompliance#isJpaQueryComplianceEnabled()} instead * via {@link #getJpaCompliance()} */ @Deprecated default boolean isStrictJpaQueryLanguageCompliance() { return getJpaCompliance().isJpaQueryComplianceEnabled(); }
private boolean isInitializeProxyWhenAccessingIdentifier() { return session != null && session.getFactory() .getSessionFactoryOptions() .getJpaCompliance().isJpaProxyComplianceEnabled(); }
public SingleTableEntityTypeDescriptor( EntityMapping bootMapping, IdentifiableTypeDescriptor<? super T> superTypeDescriptor, RuntimeModelCreationContext creationContext) throws HibernateException { super( bootMapping, superTypeDescriptor, creationContext ); isJpaCacheComplianceEnabled = creationContext.getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance() .isJpaCacheComplianceEnabled(); }
@Override public JpaCompliance getJpaCompliance() { return transactionCoordinatorOwner.getJdbcSessionOwner() .getJdbcSessionContext() .getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance(); }
@Override @SuppressWarnings("StatementWithEmptyBody") public void close() throws HibernateException { if ( isClosed() ) { if ( getFactory().getSessionFactoryOptions().getJpaCompliance().isJpaClosedComplianceEnabled() ) { throw new IllegalStateException( "Illegal call to #close() on already closed Session/EntityManager" ); } log.trace( "Already closed" ); return; } closeWithoutOpenChecks(); }