Package org.hibernate.cfg

Examples of org.hibernate.cfg.ObjectNameNormalizer


   */
  protected String determineGeneratorTableName(Properties params, Dialect dialect) {
    String name = ConfigurationHelper.getString( TABLE_PARAM, params, DEF_TABLE );
    boolean isGivenNameUnqualified = name.indexOf( '.' ) < 0;
    if ( isGivenNameUnqualified ) {
      ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
      name = normalizer.normalizeIdentifierQuoting( name );

      String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( PersistentIdentifierGenerator.SCHEMA ) );
      if ( schemaName != null ) {
        log.schemaOptionNotSupportedForTableGenerator( schemaName );
      }

      String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( PersistentIdentifierGenerator.CATALOG ) );
      if ( catalogName != null ) {
        log.catalogOptionNotSupportedForTableGenerator( catalogName );
      }
    }
    else {
View Full Code Here


   * @return The name of the segment column
   *
   * @see #getSegmentColumnName()
   */
  protected String determineSegmentColumnName(Properties params, Dialect dialect) {
    ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
    String name = ConfigurationHelper.getString( SEGMENT_COLUMN_PARAM, params, DEF_SEGMENT_COLUMN );
    return dialect.quote( normalizer.normalizeIdentifierQuoting( name ) );
  }
View Full Code Here

   * @return The name of the value column
   *
   * @see #getValueColumnName()
   */
  protected String determineValueColumnName(Properties params, Dialect dialect) {
    ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
    String name = ConfigurationHelper.getString( VALUE_COLUMN_PARAM, params, DEF_VALUE_COLUMN );
    return dialect.quote( normalizer.normalizeIdentifierQuoting( name ) );
  }
View Full Code Here

    final String sequencePerEntitySuffix = ConfigurationHelper.getString( SequenceStyleGenerator.CONFIG_SEQUENCE_PER_ENTITY_SUFFIX, params, SequenceStyleGenerator.DEF_SEQUENCE_SUFFIX );
    // JPA_ENTITY_NAME value honors <class ... entity-name="..."> (HBM) and @Entity#name (JPA) overrides.
    String sequenceName = ConfigurationHelper.getBoolean( SequenceStyleGenerator.CONFIG_PREFER_SEQUENCE_PER_ENTITY, params, false )
        ? params.getProperty( JPA_ENTITY_NAME ) + sequencePerEntitySuffix
        : SequenceStyleGenerator.DEF_SEQUENCE_NAME;
    final ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
    sequenceName = ConfigurationHelper.getString( SequenceStyleGenerator.SEQUENCE_PARAM, params, sequenceName );
    if ( sequenceName.indexOf( '.' ) < 0 ) {
      sequenceName = normalizer.normalizeIdentifierQuoting( sequenceName );

      final String schemaName = params.getProperty( PersistentIdentifierGenerator.SCHEMA );
      if ( schemaName != null ) {
        log.schemaOptionNotSupportedForSequenceGenerator( schemaName );
      }
View Full Code Here

   */
  protected String determineGeneratorTableName(Properties params, Dialect dialect) {
    String name = ConfigurationHelper.getString( TABLE_PARAM, params, DEF_TABLE );
    boolean isGivenNameUnqualified = name.indexOf( '.' ) < 0;
    if ( isGivenNameUnqualified ) {
      ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
      name = normalizer.normalizeIdentifierQuoting( name );

      String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( PersistentIdentifierGenerator.SCHEMA ) );
      if ( schemaName != null ) {
        log.schemaOptionNotSupportedForTableGenerator( schemaName );
      }

      String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( PersistentIdentifierGenerator.CATALOG ) );
      if ( catalogName != null ) {
        log.catalogOptionNotSupportedForTableGenerator( catalogName );
      }
    }
    else {
View Full Code Here

   * @return The name of the segment column
   *
   * @see #getSegmentColumnName()
   */
  protected String determineSegmentColumnName(Properties params, Dialect dialect) {
    ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
    String name = ConfigurationHelper.getString( SEGMENT_COLUMN_PARAM, params, DEF_SEGMENT_COLUMN );
    return dialect.quote( normalizer.normalizeIdentifierQuoting( name ) );
  }
View Full Code Here

   * @return The name of the value column
   *
   * @see #getValueColumnName()
   */
  protected String determineValueColumnName(Properties params, Dialect dialect) {
    ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
    String name = ConfigurationHelper.getString( VALUE_COLUMN_PARAM, params, DEF_VALUE_COLUMN );
    return dialect.quote( normalizer.normalizeIdentifierQuoting( name ) );
  }
View Full Code Here

    final String sequencePerEntitySuffix = ConfigurationHelper.getString( SequenceStyleGenerator.CONFIG_SEQUENCE_PER_ENTITY_SUFFIX, params, SequenceStyleGenerator.DEF_SEQUENCE_SUFFIX );
    // JPA_ENTITY_NAME value honors <class ... entity-name="..."> (HBM) and @Entity#name (JPA) overrides.
    String sequenceName = ConfigurationHelper.getBoolean( SequenceStyleGenerator.CONFIG_PREFER_SEQUENCE_PER_ENTITY, params, false )
        ? params.getProperty( JPA_ENTITY_NAME ) + sequencePerEntitySuffix
        : SequenceStyleGenerator.DEF_SEQUENCE_NAME;
    final ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER );
    sequenceName = ConfigurationHelper.getString( SequenceStyleGenerator.SEQUENCE_PARAM, params, sequenceName );
    if ( sequenceName.indexOf( '.' ) < 0 ) {
      sequenceName = normalizer.normalizeIdentifierQuoting( sequenceName );

      final String schemaName = params.getProperty( PersistentIdentifierGenerator.SCHEMA );
      if ( schemaName != null ) {
        log.schemaOptionNotSupportedForSequenceGenerator( schemaName );
      }
View Full Code Here

  protected Type getIdentifierType() {
    return identifierType;
  }

  public void configure(Type type, Properties params, Dialect dialect) throws MappingException {
    ObjectNameNormalizer normalizer = ( ObjectNameNormalizer ) params.get( IDENTIFIER_NORMALIZER );
    sequenceName = normalizer.normalizeIdentifierQuoting(
        PropertiesHelper.getString( SEQUENCE, params, "hibernate_sequence" )
    );
    parameters = params.getProperty( PARAMETERS );

    if ( sequenceName.indexOf( '.' ) < 0 ) {
      final String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) );
      final String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) );
      sequenceName = Table.qualify(
          dialect.quote( catalogName ),
          dialect.quote( schemaName ),
          dialect.quote( sequenceName )
      );
View Full Code Here

   * @param params The params supplied in the generator config (plus some standard useful extras).
   * @param dialect The dialect in effect
   * @return The sequence name
   */
  protected String determineSequenceName(Properties params, Dialect dialect) {
    ObjectNameNormalizer normalizer = ( ObjectNameNormalizer ) params.get( IDENTIFIER_NORMALIZER );
    String sequenceName = PropertiesHelper.getString( SEQUENCE_PARAM, params, DEF_SEQUENCE_NAME );
    if ( sequenceName.indexOf( '.' ) < 0 ) {
      sequenceName = normalizer.normalizeIdentifierQuoting( sequenceName );
      String schemaName = params.getProperty( SCHEMA );
      String catalogName = params.getProperty( CATALOG );
      sequenceName = Table.qualify(
          dialect.quote( catalogName ),
          dialect.quote( schemaName ),
View Full Code Here

TOP

Related Classes of org.hibernate.cfg.ObjectNameNormalizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.