public ParameterSubstitutionRecognizer(SessionFactoryImplementor factory) { this.jdbcPositionalParamCount = factory.getSessionFactoryOptions().jdbcStyleParamsZeroBased() ? 0 : 1; }
protected String qualify(String regionName) { return sessionFactory.getSessionFactoryOptions().getCacheRegionPrefix() == null ? regionName : sessionFactory.getSessionFactoryOptions().getCacheRegionPrefix() + '.' + regionName; }
/** * Constructs a JoinSequence * * @param factory The SessionFactory */ public JoinSequence(SessionFactoryImplementor factory) { this.factory = factory; this.collectionJoinSubquery = factory.getSessionFactoryOptions().isCollectionJoinSubqueryRewriteEnabled(); }
/** * Constructs a Nullability * * @param session The session */ public Nullability(SharedSessionContractImplementor session) { this.session = session; this.checkNullability = session.getFactory().getSessionFactoryOptions().isCheckNullability(); } /**
public ExceptionConverterImpl(SharedSessionContractImplementor sharedSessionContract) { this.sharedSessionContract = sharedSessionContract; isJpaBootstrap = sharedSessionContract.getFactory().getSessionFactoryOptions().isJpaBootstrap(); nativeExceptionHandling51Compliance = sharedSessionContract.getFactory().getSessionFactoryOptions().nativeExceptionHandling51Compliance(); }
private boolean isInitializeProxyWhenAccessingIdentifier() { return session != null && session.getFactory() .getSessionFactoryOptions() .getJpaCompliance().isJpaProxyComplianceEnabled(); }
private void performInjections(T listener) { if ( CallbackRegistryConsumer.class.isInstance( listener ) ) { ( (CallbackRegistryConsumer) listener ).injectCallbackRegistry( listenerRegistry.getCallbackRegistry() ); } if ( JpaBootstrapSensitive.class.isInstance( listener ) ) { ( (JpaBootstrapSensitive) listener ).wasJpaBootstrap( listenerRegistry.getSessionFactory().getSessionFactoryOptions().isJpaBootstrap() ); } }
public StatisticsImpl(SessionFactoryImplementor sessionFactory) { this.sessionFactory = sessionFactory; this.queryStatsMap = new BoundedConcurrentHashMap( sessionFactory != null ? sessionFactory.getSessionFactoryOptions().getQueryStatisticsMaxSize() : Statistics.DEFAULT_QUERY_STATISTICS_MAX_SIZE, 20, BoundedConcurrentHashMap.Eviction.LRU ); clear(); }
@Override public JpaCompliance getJpaCompliance() { return transactionCoordinatorOwner.getJdbcSessionOwner() .getJdbcSessionContext() .getSessionFactory() .getSessionFactoryOptions() .getJpaCompliance(); }
@Override protected String renderOrderByElement(String expression, String collation, String order, String nulls) { final NullPrecedence nullPrecedence = NullPrecedence.parse( nulls, sessionFactory.getSessionFactoryOptions().getDefaultNullPrecedence() ); return sessionFactory.getDialect().renderOrderByElement( expression, collation, order, nullPrecedence ); } }
protected void prepareForPossibleLoadingOutsideTransaction() { if ( session != null ) { allowLoadOutsideTransaction = session.getFactory().getSessionFactoryOptions().isInitializeLazyStateOutsideTransactionsEnabled(); if ( allowLoadOutsideTransaction && sessionFactoryUuid == null ) { sessionFactoryUuid = session.getFactory().getUuid(); } } }
public boolean isBatchable() { return optimisticLockStyle() == OptimisticLockStyle.NONE || ( !isVersioned() && optimisticLockStyle() == OptimisticLockStyle.VERSION ) || getFactory().getSessionFactoryOptions().isJdbcBatchVersionedData(); }
private String generateDelete(String tableName, String[] columnNames, String idSubselect, String comment) { final Delete delete = new Delete() .setTableName( tableName ) .setWhere( "(" + String.join( ", ", columnNames ) + ") IN (" + idSubselect + ")" ); if ( factory().getSessionFactoryOptions().isCommentsEnabled() ) { delete.setComment( comment ); } return delete.toStatementString(); }
public MultiTableDeleteExecutor(HqlSqlWalker walker) { final MultiTableBulkIdStrategy strategy = walker.getSessionFactoryHelper().getFactory().getSessionFactoryOptions() .getMultiTableBulkIdStrategy(); this.deleteHandler = strategy.buildDeleteHandler( walker.getSessionFactoryHelper().getFactory(), walker ); }
public MultiTableUpdateExecutor(HqlSqlWalker walker) { MultiTableBulkIdStrategy strategy = walker.getSessionFactoryHelper() .getFactory() .getSessionFactoryOptions() .getMultiTableBulkIdStrategy(); this.updateHandler = strategy.buildUpdateHandler( walker.getSessionFactoryHelper().getFactory(), walker ); }
private static boolean useMinimalPuts(SharedSessionContractImplementor session, EntityEntry entityEntry) { if ( session.getFactory().getSessionFactoryOptions().isMinimalPutsEnabled() ) { return session.getCacheMode() != CacheMode.REFRESH; } else { return entityEntry.getPersister().hasLazyProperties() && entityEntry.getPersister().isLazyPropertiesCacheable(); } }
private String generateVersionIncrementUpdateString() { Update update = new Update( getFactory().getDialect() ); update.setTableName( getTableName( 0 ) ); if ( getFactory().getSessionFactoryOptions().isCommentsEnabled() ) { update.setComment( "forced version increment" ); } update.addColumn( getVersionColumnName() ); update.addPrimaryKeyColumns( rootTableKeyColumnNames ); update.setVersionColumnName( getVersionColumnName() ); return update.toStatementString(); }
protected String generateLockString() { final SessionFactoryImplementor factory = lockable.getFactory(); final Update update = new Update( factory.getDialect() ); update.setTableName( lockable.getRootTableName() ); update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() ); update.setVersionColumnName( lockable.getVersionColumnName() ); update.addColumn( lockable.getVersionColumnName() ); if ( factory.getSessionFactoryOptions().isCommentsEnabled() ) { update.setComment( lockMode + " lock " + lockable.getEntityName() ); } return update.toStatementString(); }
protected String generateLockString() { final SessionFactoryImplementor factory = lockable.getFactory(); final Update update = new Update( factory.getDialect() ); update.setTableName( lockable.getRootTableName() ); update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() ); update.setVersionColumnName( lockable.getVersionColumnName() ); update.addColumn( lockable.getVersionColumnName() ); if ( factory.getSessionFactoryOptions().isCommentsEnabled() ) { update.setComment( lockMode + " lock " + lockable.getEntityName() ); } return update.toStatementString(); }
protected String generateLockString() { final SessionFactoryImplementor factory = lockable.getFactory(); final Update update = new Update( factory.getDialect() ); update.setTableName( lockable.getRootTableName() ); update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() ); update.setVersionColumnName( lockable.getVersionColumnName() ); update.addColumn( lockable.getVersionColumnName() ); if ( factory.getSessionFactoryOptions().isCommentsEnabled() ) { update.setComment( lockMode + " lock " + lockable.getEntityName() ); } return update.toStatementString(); }