@Transactional public String getHibernateDialect(){ return ((SessionFactoryImpl)sessionFactory).getDialect().toString(); }
@Transactional public String getHibernateDialect(){ return ((SessionFactoryImpl)sessionFactory).getDialect().toString(); }
@Transactional public String getHibernateDialect(){ return ((SessionFactoryImpl)sessionFactory).getDialect().toString(); }
public String getUniqueString() { final SessionFactoryImpl ss = (SessionFactoryImpl) sessionFactory; final String sql = ss.getDialect().getSequenceNextValString("UUID_SEQ"); final SQLQuery q = sessionFactory.getCurrentSession().createSQLQuery(sql); final long value = ((BigInteger) q.uniqueResult()).longValue(); return UUID.randomUUID().toString().replaceAll("-", "") + value; }
public String getUniqueString() { final SessionFactoryImpl ss = (SessionFactoryImpl) sessionFactory; final String sql = ss.getDialect().getSequenceNextValString("UUID_SEQ"); final SQLQuery q = sessionFactory.getCurrentSession().createSQLQuery(sql); final long value = ((BigInteger) q.uniqueResult()).longValue(); return UUID.randomUUID().toString().replaceAll("-", "") + value; }
public long getUniqueNumber() { final SessionFactoryImpl ss = (SessionFactoryImpl) sessionFactory; final String sql = ss.getDialect().getSequenceNextValString("UUID_SEQ"); final SQLQuery q = sessionFactory.getCurrentSession().createSQLQuery(sql); final long value = ((BigInteger) q.uniqueResult()).longValue(); return value + System.nanoTime(); }
public long getUniqueNumber() { final SessionFactoryImpl ss = (SessionFactoryImpl) sessionFactory; final String sql = ss.getDialect().getSequenceNextValString("UUID_SEQ"); final SQLQuery q = sessionFactory.getCurrentSession().createSQLQuery(sql); final long value = ((BigInteger) q.uniqueResult()).longValue(); return value + System.nanoTime(); }
protected Long generateUniqueId() { final SessionFactoryImpl ss = (SessionFactoryImpl) sessionFactory; final String sql = ss.getDialect().getSequenceNextValString("ID_SEQ"); final SQLQuery q = sessionFactory.getCurrentSession().createSQLQuery(sql); return ((BigInteger) q.uniqueResult()).longValue(); }
protected Long generateUniqueId() { final SessionFactoryImpl ss = (SessionFactoryImpl) sessionFactory; final String sql = ss.getDialect().getSequenceNextValString("ID_SEQ"); final SQLQuery q = sessionFactory.getCurrentSession().createSQLQuery(sql); return ((BigInteger) q.uniqueResult()).longValue(); }
protected Long generateUniqueId() { final SessionFactoryImpl ss = entityManager.unwrap(SessionFactoryImpl.class); final String sql = ss.getDialect().getSequenceNextValString("ID_SEQ"); final SQLQuery q = currentSession().createSQLQuery(sql); return ((BigInteger) q.uniqueResult()).longValue(); }
protected Long generateUniqueId() { final SessionFactoryImpl ss = entityManager.unwrap(SessionFactoryImpl.class); final String sql = ss.getDialect().getSequenceNextValString("ID_SEQ"); final SQLQuery q = currentSession().createSQLQuery(sql); return ((BigInteger) q.uniqueResult()).longValue(); }
if(sessionFactoryImpl.getDialect() != null) { for(int i =0; i<details.size(); i++) { if(details.get(i).getLabel().equals(DETAILS_HIBERNATE_DIALECT)) { String dialect = sessionFactoryImpl.getDialect().getClass().getName(); details.add(new LabeledString(DETAILS_HIBERNATE_DIALECT, dialect));
@Test public void testLimit() { final RowSelection rowSelection = new RowSelection(); rowSelection.setMaxRows(getMaxRows()); LimitHandler limitHandler = ((SessionFactoryImpl) sessionFactory()).getDialect().getLimitHandler(); String limitStatement = limitHandler.processSql(SELECT_POST_COMMENT, rowSelection); long startNanos = System.nanoTime(); doInJDBC(connection -> { try (PreparedStatement statement = connection.prepareStatement(limitStatement)) { limitHandler.bindLimitParametersAtEndOfQuery(rowSelection, statement, 1); statement.setInt(1, getMaxRows()); statement.execute(); int count = 0; ResultSet resultSet = statement.getResultSet(); while (resultSet.next()) { resultSet.getLong(1); count++; } assertEquals(getMaxRows(), count); } catch (SQLException e) { fail(e.getMessage()); } }); LOGGER.info("{} Result Set with limit took {} millis", dataSourceProvider().database(), TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos)); }
this.jdbcServices = this.serviceRegistry.getService( JdbcServices.class ); this.dialect = this.jdbcServices.getDialect(); this.sqlFunctionRegistry = new SQLFunctionRegistry( getDialect(), cfg.getSqlFunctions() ); if ( observer != null ) { this.observer.addObserver( observer ); IdentifierGenerator generator = model.getIdentifier().createIdentifierGenerator( cfg.getIdentifierGeneratorFactory(), getDialect(), settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), while ( classes.hasNext() ) { final PersistentClass model = (PersistentClass) classes.next(); model.prepareTemporaryTables( mapping, getDialect() ); final String cacheRegionName = cacheRegionPrefix + model.getRootClass().getCacheRegionName();
this.jdbcServices = this.serviceRegistry.getService( JdbcServices.class ); this.dialect = this.jdbcServices.getDialect(); this.sqlFunctionRegistry = new SQLFunctionRegistry( getDialect(), cfg.getSqlFunctions() ); if ( observer != null ) { this.observer.addObserver( observer ); IdentifierGenerator generator = model.getIdentifier().createIdentifierGenerator( cfg.getIdentifierGeneratorFactory(), getDialect(), settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), while ( classes.hasNext() ) { final PersistentClass model = (PersistentClass) classes.next(); model.prepareTemporaryTables( mapping, getDialect() ); final String cacheRegionName = cacheRegionPrefix + model.getRootClass().getCacheRegionName();
Dialect dialect = factory.getDialect(); if (dialect instanceof InstallableDialect) { ((InstallableDialect)dialect).install(factory);