Package org.hibernate.mapping

Examples of org.hibernate.mapping.AuxiliaryDatabaseObject


    }
    mappings.addTypeDef( typeName, typeClass, parameters );
  }

  private static void bindAuxiliaryDatabaseObject(Element auxDbObjectNode, Mappings mappings) {
    AuxiliaryDatabaseObject auxDbObject = null;
    Element definitionNode = auxDbObjectNode.element( "definition" );
    if ( definitionNode != null ) {
      try {
        auxDbObject = ( AuxiliaryDatabaseObject ) ReflectHelper
            .classForName( definitionNode.attributeValue( "class" ) )
            .newInstance();
      }
      catch( ClassNotFoundException e ) {
        throw new MappingException(
            "could not locate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
      catch( Throwable t ) {
        throw new MappingException(
            "could not instantiate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
    }
    else {
      auxDbObject = new SimpleAuxiliaryDatabaseObject(
          auxDbObjectNode.elementTextTrim( "create" ),
          auxDbObjectNode.elementTextTrim( "drop" )
        );
    }

    Iterator dialectScopings = auxDbObjectNode.elementIterator( "dialect-scope" );
    while ( dialectScopings.hasNext() ) {
      Element dialectScoping = ( Element ) dialectScopings.next();
      auxDbObject.addDialectScope( dialectScoping.attributeValue( "name" ) );
    }

    mappings.addAuxiliaryDatabaseObject( auxDbObject );
  }
View Full Code Here


    // drop them in reverse order in case db needs it done that way...
    {
      ListIterator itr = auxiliaryDatabaseObjects.listIterator( auxiliaryDatabaseObjects.size() );
      while ( itr.hasPrevious() ) {
        AuxiliaryDatabaseObject object = (AuxiliaryDatabaseObject) itr.previous();
        if ( object.appliesToDialect( dialect ) ) {
          script.add( object.sqlDropString( dialect, defaultCatalog, defaultSchema ) );
        }
      }
    }

    if ( dialect.dropConstraints() ) {
View Full Code Here

    }
    mappings.addTypeDef( typeName, typeClass, parameters );
  }

  private static void bindAuxiliaryDatabaseObject(Element auxDbObjectNode, Mappings mappings) {
    AuxiliaryDatabaseObject auxDbObject = null;
    Element definitionNode = auxDbObjectNode.element( "definition" );
    if ( definitionNode != null ) {
      try {
        auxDbObject = ( AuxiliaryDatabaseObject ) ReflectHelper
            .classForName( definitionNode.attributeValue( "class" ) )
            .newInstance();
      }
      catch( ClassNotFoundException e ) {
        throw new MappingException(
            "could not locate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
      catch( Throwable t ) {
        throw new MappingException(
            "could not instantiate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
    }
    else {
      auxDbObject = new SimpleAuxiliaryDatabaseObject(
          auxDbObjectNode.elementTextTrim( "create" ),
          auxDbObjectNode.elementTextTrim( "drop" )
        );
    }

    Iterator dialectScopings = auxDbObjectNode.elementIterator( "dialect-scope" );
    while ( dialectScopings.hasNext() ) {
      Element dialectScoping = ( Element ) dialectScopings.next();
      auxDbObject.addDialectScope( dialectScoping.attributeValue( "name" ) );
    }

    mappings.addAuxiliaryDatabaseObject( auxDbObject );
  }
View Full Code Here

    }
    mappings.addTypeDef( typeName, typeClass, parameters );
  }

  private static void bindAuxiliaryDatabaseObject(Element auxDbObjectNode, Mappings mappings) {
    AuxiliaryDatabaseObject auxDbObject = null;
    Element definitionNode = auxDbObjectNode.element( "definition" );
    if ( definitionNode != null ) {
      try {
        auxDbObject = ( AuxiliaryDatabaseObject ) ReflectHelper
            .classForName( definitionNode.attributeValue( "class" ) )
            .newInstance();
      }
      catch( ClassNotFoundException e ) {
        throw new MappingException(
            "could not locate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
      catch( Throwable t ) {
        throw new MappingException(
            "could not instantiate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
    }
    else {
      auxDbObject = new SimpleAuxiliaryDatabaseObject(
          auxDbObjectNode.elementTextTrim( "create" ),
          auxDbObjectNode.elementTextTrim( "drop" )
        );
    }

    Iterator dialectScopings = auxDbObjectNode.elementIterator( "dialect-scope" );
    while ( dialectScopings.hasNext() ) {
      Element dialectScoping = ( Element ) dialectScopings.next();
      auxDbObject.addDialectScope( dialectScoping.attributeValue( "name" ) );
    }

    mappings.addAuxiliaryDatabaseObject( auxDbObject );
  }
View Full Code Here

    ArrayList script = new ArrayList( 50 );

    // drop them in reverse order in case db needs it done that way...
    ListIterator itr = auxiliaryDatabaseObjects.listIterator( auxiliaryDatabaseObjects.size() );
    while ( itr.hasPrevious() ) {
      AuxiliaryDatabaseObject object = (AuxiliaryDatabaseObject) itr.previous();
      if ( object.appliesToDialect( dialect ) ) {
        script.add( object.sqlDropString( dialect, defaultCatalog, defaultSchema ) );
      }
    }

    if ( dialect.dropConstraints() ) {
      Iterator iter = getTableMappings();
View Full Code Here

      }
    }

    Iterator itr = auxiliaryDatabaseObjects.iterator();
    while ( itr.hasNext() ) {
      AuxiliaryDatabaseObject object = (AuxiliaryDatabaseObject) itr.next();
      if ( object.appliesToDialect( dialect ) ) {
        script.add( object.sqlCreateString( dialect, mapping, defaultCatalog, defaultSchema ) );
      }
    }

    return ArrayHelper.toStringArray( script );
  }
View Full Code Here

    }
    mappings.addTypeDef( typeName, typeClass, parameters );
  }

  private static void bindAuxiliaryDatabaseObject(Element auxDbObjectNode, Mappings mappings) {
    AuxiliaryDatabaseObject auxDbObject = null;
    Element definitionNode = auxDbObjectNode.element( "definition" );
    if ( definitionNode != null ) {
      try {
        auxDbObject = ( AuxiliaryDatabaseObject ) ReflectHelper
            .classForName( definitionNode.attributeValue( "class" ) )
            .newInstance();
      }
      catch( ClassNotFoundException e ) {
        throw new MappingException(
            "could not locate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
      catch( Throwable t ) {
        throw new MappingException(
            "could not instantiate custom database object class [" +
            definitionNode.attributeValue( "class" ) + "]"
          );
      }
    }
    else {
      auxDbObject = new SimpleAuxiliaryDatabaseObject(
          auxDbObjectNode.elementTextTrim( "create" ),
          auxDbObjectNode.elementTextTrim( "drop" )
        );
    }

    Iterator dialectScopings = auxDbObjectNode.elementIterator( "dialect-scope" );
    while ( dialectScopings.hasNext() ) {
      Element dialectScoping = ( Element ) dialectScopings.next();
      auxDbObject.addDialectScope( dialectScoping.attributeValue( "name" ) );
    }

    mappings.addAuxiliaryDatabaseObject( auxDbObject );
  }
View Full Code Here

    // drop them in reverse order in case db needs it done that way...
    {
      ListIterator itr = auxiliaryDatabaseObjects.listIterator( auxiliaryDatabaseObjects.size() );
      while ( itr.hasPrevious() ) {
        AuxiliaryDatabaseObject object = (AuxiliaryDatabaseObject) itr.previous();
        if ( object.appliesToDialect( dialect ) ) {
          script.add( object.sqlDropString( dialect, defaultCatalog, defaultSchema ) );
        }
      }
    }

    if ( dialect.dropConstraints() ) {
View Full Code Here

    ArrayList script = new ArrayList( 50 );

    // drop them in reverse order in case db needs it done that way...
    ListIterator itr = auxiliaryDatabaseObjects.listIterator( auxiliaryDatabaseObjects.size() );
    while ( itr.hasPrevious() ) {
      AuxiliaryDatabaseObject object = (AuxiliaryDatabaseObject) itr.previous();
      if ( object.appliesToDialect( dialect ) ) {
        script.add( object.sqlDropString( dialect, defaultCatalog, defaultSchema ) );
      }
    }

    if ( dialect.dropConstraints() ) {
      Iterator iter = getTableMappings();
View Full Code Here

      }
    }

    Iterator itr = auxiliaryDatabaseObjects.iterator();
    while ( itr.hasNext() ) {
      AuxiliaryDatabaseObject object = (AuxiliaryDatabaseObject) itr.next();
      if ( object.appliesToDialect( dialect ) ) {
        script.add( object.sqlCreateString( dialect, mapping, defaultCatalog, defaultSchema ) );
      }
    }

    return ArrayHelper.toStringArray( script );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.AuxiliaryDatabaseObject

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.