org.hibernate.cfg.Settings.isCommentsEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.hibernate.cfg.Settings.isCommentsEnabled()方法的一些代码示例,展示了Settings.isCommentsEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.isCommentsEnabled()方法的具体详情如下:
包路径:org.hibernate.cfg.Settings
类名称:Settings
方法名:isCommentsEnabled

Settings.isCommentsEnabled介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

if ( getFactory().getSettings().isCommentsEnabled() ) {
  select.setComment( "load collection " + collectionPersister.getRole() );

代码示例来源:origin: hibernate/hibernate-orm

if ( getFactory().getSettings().isCommentsEnabled() ) {
  select.setComment( "load " + getEntityName() );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

/**
 * Modify the SQL, adding lock hints and comments, if necessary
 */
protected String preprocessSQL(String sql, QueryParameters parameters, Dialect dialect)
    throws HibernateException {
  sql = applyLocks( sql, parameters.getLockOptions(), dialect );
  return getFactory().getSettings().isCommentsEnabled() ?
      prependComment( sql, parameters ) : sql;
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

/**
 * Modify the SQL, adding lock hints and comments, if necessary
 */
protected String preprocessSQL(String sql, QueryParameters parameters, Dialect dialect)
    throws HibernateException {
  
  sql = applyLocks( sql, parameters.getLockModes(), dialect );
  
  return getFactory().getSettings().isCommentsEnabled() ?
      prependComment( sql, parameters ) : sql;
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Modify the SQL, adding lock hints and comments, if necessary
 */
protected String preprocessSQL(String sql, QueryParameters parameters, Dialect dialect)
    throws HibernateException {
  sql = applyLocks( sql, parameters.getLockOptions(), dialect );
  return getFactory().getSettings().isCommentsEnabled() ?
      prependComment( sql, parameters ) : sql;
}

代码示例来源:origin: hibernate/hibernate

/**
 * Modify the SQL, adding lock hints and comments, if necessary
 */
protected String preprocessSQL(String sql, QueryParameters parameters, Dialect dialect)
    throws HibernateException {
  
  sql = applyLocks( sql, parameters.getLockModes(), dialect );
  
  return getFactory().getSettings().isCommentsEnabled() ?
      prependComment( sql, parameters ) : sql;
}

代码示例来源:origin: hibernate/hibernate

/**
 * Generate the SQL DELETE that deletes all rows
 */
protected String generateDeleteString() {
  
  Delete delete = new Delete()
      .setTableName( qualifiedTableName )
      .setPrimaryKeyColumnNames( keyColumnNames );
  
  if ( hasWhere ) delete.setWhere( sqlWhereString );
  
  if ( getFactory().getSettings().isCommentsEnabled() ) {
    delete.setComment( "delete collection " + getRole() );
  }
  
  return delete.toStatementString();
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

/**
 * Generate the SQL DELETE that deletes all rows
 */
protected String generateDeleteString() {
  
  Delete delete = new Delete()
      .setTableName( qualifiedTableName )
      .setPrimaryKeyColumnNames( keyColumnNames );
  
  if ( hasWhere ) delete.setWhere( sqlWhereString );
  
  if ( getFactory().getSettings().isCommentsEnabled() ) {
    delete.setComment( "delete collection " + getRole() );
  }
  
  return delete.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

/**
 * Generate the SQL DELETE that deletes all rows
 */
@Override
protected String generateDeleteString() {
  
  Delete delete = new Delete()
      .setTableName( qualifiedTableName )
      .addPrimaryKeyColumns( keyColumnNames );
  
  if ( hasWhere ) delete.setWhere( sqlWhereString );
  
  if ( getFactory().getSettings().isCommentsEnabled() ) {
    delete.setComment( "delete collection " + getRole() );
  }
  
  return delete.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Generate the SQL DELETE that deletes all rows
 */
@Override
protected String generateDeleteString() {
  
  Delete delete = new Delete()
      .setTableName( qualifiedTableName )
      .addPrimaryKeyColumns( keyColumnNames );
  
  if ( hasWhere ) delete.setWhere( sqlWhereString );
  
  if ( getFactory().getSettings().isCommentsEnabled() ) {
    delete.setComment( "delete collection " + getRole() );
  }
  
  return delete.toStatementString();
}

代码示例来源:origin: hibernate/hibernate

/**
 * Generate the SQL that deletes a row by id (and version)
 */
protected String generateDeleteString(int j) {
  Delete delete = new Delete()
      .setTableName( getTableName( j ) )
      .setPrimaryKeyColumnNames( getKeyColumns( j ) );
  if ( j == 0 ) delete.setVersionColumnName( getVersionColumnName() );
  if ( getFactory().getSettings().isCommentsEnabled() ) {
    delete.setComment( "delete " + getEntityName() );
  }
  return delete.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

protected String generateLockString() {
  SessionFactoryImplementor factory = lockable.getFactory();
  Update update = new Update( factory.getDialect() );
  update.setTableName( lockable.getRootTableName() );
  update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() );
  update.setVersionColumnName( lockable.getVersionColumnName() );
  update.addColumn( lockable.getVersionColumnName() );
  if ( factory.getSettings().isCommentsEnabled() ) {
    update.setComment( lockMode + " lock " + lockable.getEntityName() );
  }
  return update.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

protected String generateLockString() {
  SessionFactoryImplementor factory = lockable.getFactory();
  Update update = new Update( factory.getDialect() );
  update.setTableName( lockable.getRootTableName() );
  update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() );
  update.setVersionColumnName( lockable.getVersionColumnName() );
  update.addColumn( lockable.getVersionColumnName() );
  if ( factory.getSettings().isCommentsEnabled() ) {
    update.setComment( lockMode + " lock " + lockable.getEntityName() );
  }
  return update.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private String generateVersionIncrementUpdateString() {
  Update update = new Update( getFactory().getDialect() );
  update.setTableName( getTableName( 0 ) );
  if ( getFactory().getSettings().isCommentsEnabled() ) {
    update.setComment( "forced version increment" );
  }
  update.addColumn( getVersionColumnName() );
  update.addPrimaryKeyColumns( getIdentifierColumnNames() );
  update.setVersionColumnName( getVersionColumnName() );
  return update.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

protected String generateLockString() {
  SessionFactoryImplementor factory = lockable.getFactory();
  Update update = new Update( factory.getDialect() );
  update.setTableName( lockable.getRootTableName() );
  update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() );
  update.setVersionColumnName( lockable.getVersionColumnName() );
  update.addColumn( lockable.getVersionColumnName() );
  if ( factory.getSettings().isCommentsEnabled() ) {
    update.setComment( lockMode + " lock " + lockable.getEntityName() );
  }
  return update.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

protected String generateLockString() {
  SessionFactoryImplementor factory = lockable.getFactory();
  Update update = new Update( factory.getDialect() );
  update.setTableName( lockable.getRootTableName() );
  update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() );
  update.setVersionColumnName( lockable.getVersionColumnName() );
  update.addColumn( lockable.getVersionColumnName() );
  if ( factory.getSettings().isCommentsEnabled() ) {
    update.setComment( lockMode + " lock " + lockable.getEntityName() );
  }
  return update.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

protected String generateLockString() {
  SessionFactoryImplementor factory = lockable.getFactory();
  Update update = new Update( factory.getDialect() );
  update.setTableName( lockable.getRootTableName() );
  update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() );
  update.setVersionColumnName( lockable.getVersionColumnName() );
  update.addColumn( lockable.getVersionColumnName() );
  if ( factory.getSettings().isCommentsEnabled() ) {
    update.setComment( lockMode + " lock " + lockable.getEntityName() );
  }
  return update.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private String generateVersionIncrementUpdateString() {
  Update update = new Update( getFactory().getDialect() );
  update.setTableName( getTableName( 0 ) );
  if ( getFactory().getSettings().isCommentsEnabled() ) {
    update.setComment( "forced version increment" );
  }
  update.addColumn( getVersionColumnName() );
  update.addPrimaryKeyColumns( getIdentifierColumnNames() );
  update.setVersionColumnName( getVersionColumnName() );
  return update.toStatementString();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

protected String generateLockString() {
  SessionFactoryImplementor factory = lockable.getFactory();
  Update update = new Update( factory.getDialect() );
  update.setTableName( lockable.getRootTableName() );
  update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() );
  update.setVersionColumnName( lockable.getVersionColumnName() );
  update.addColumn( lockable.getVersionColumnName() );
  if ( factory.getSettings().isCommentsEnabled() ) {
    update.setComment( lockMode + " lock " + lockable.getEntityName() );
  }
  return update.toStatementString();
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

protected String generateLockString() {
  SessionFactoryImplementor factory = lockable.getFactory();
  Update update = new Update( factory.getDialect() );
  update.setTableName( lockable.getRootTableName() );
  update.setPrimaryKeyColumnNames( lockable.getRootTableIdentifierColumnNames() );
  update.setVersionColumnName( lockable.getVersionColumnName() );
  update.addColumn( lockable.getVersionColumnName() );
  if ( factory.getSettings().isCommentsEnabled() ) {
    update.setComment( lockMode + " lock " + lockable.getEntityName() );
  }
  return update.toStatementString();
}

相关文章

Settings类方法