Package org.hibernate.mapping

Examples of org.hibernate.mapping.Table


    Attribute catalogNode = node.attribute( "catalog" );
    String catalog = catalogNode == null ?
        mappings.getCatalogName() : catalogNode.getValue();

    Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable();
    Table mytable = mappings.addDenormalizedTable(
        schema,
        catalog,
        getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ),
            unionSubclass.isAbstract() != null && unionSubclass.isAbstract(),
        getSubselect( node ),
View Full Code Here


    Attribute catalogNode = node.attribute( "catalog" );
    String catalog = catalogNode == null ?
        mappings.getCatalogName() : catalogNode.getValue();

    Table mytable = mappings.addTable(
        schema,
        catalog,
        getClassTableName( joinedSubclass, node, schema, catalog, null, mappings ),
        getSubselect( node ),
        false
      );
    joinedSubclass.setTable( mytable );
    bindComment(mytable, node);

    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( "Mapping joined-subclass: %s -> %s", joinedSubclass.getEntityName(), joinedSubclass.getTable().getName() );
    }

    // KEY
    Element keyNode = node.element( "key" );
    SimpleValue key = new DependantValue( mappings, mytable, joinedSubclass.getIdentifier() );
    joinedSubclass.setKey( key );
    key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
    bindSimpleValue( keyNode, key, false, joinedSubclass.getEntityName(), mappings );

    // model.getKey().setType( new Type( model.getIdentifier() ) );
    joinedSubclass.createPrimaryKey();
    joinedSubclass.createForeignKey();

    // CHECK
    Attribute chNode = node.attribute( "check" );
    if ( chNode != null ) mytable.addCheckConstraint( chNode.getValue() );

    // properties
    createClassProperties( node, joinedSubclass, mappings, inheritedMetas );

  }
View Full Code Here

    String schema = schemaNode == null ?
        mappings.getSchemaName() : schemaNode.getValue();
    Attribute catalogNode = node.attribute( "catalog" );
    String catalog = catalogNode == null ?
        mappings.getCatalogName() : catalogNode.getValue();
    Table primaryTable = persistentClass.getTable();
    Table table = mappings.addTable(
        schema,
        catalog,
        getClassTableName( persistentClass, node, schema, catalog, primaryTable, mappings ),
        getSubselect( node ),
        false
View Full Code Here

  public static void bindColumns(final Element node, final SimpleValue simpleValue,
      final boolean isNullable, final boolean autoColumn, final String propertyPath,
      final Mappings mappings) throws MappingException {

    Table table = simpleValue.getTable();

    // COLUMN(S)
    Attribute columnAttribute = node.attribute( "column" );
    if ( columnAttribute == null ) {
      Iterator itr = node.elementIterator();
      int count = 0;
      while ( itr.hasNext() ) {
        Element columnElement = (Element) itr.next();
        if ( columnElement.getName().equals( "column" ) ) {
          Column column = new Column();
          column.setValue( simpleValue );
          column.setTypeIndex( count++ );
          bindColumn( columnElement, column, isNullable );
          String columnName = columnElement.attributeValue( "name" );
          String logicalColumnName = mappings.getNamingStrategy().logicalColumnName(
              columnName, propertyPath
          );
          columnName = mappings.getNamingStrategy().columnName( columnName );
          columnName = quoteIdentifier( columnName, mappings );
          column.setName( columnName );
          if ( table != null ) {
            table.addColumn( column ); // table=null -> an association
                                       // - fill it in later
            //TODO fill in the mappings for table == null
            mappings.addColumnBinding( logicalColumnName, column, table );
          }


          simpleValue.addColumn( column );
          // column index
          bindIndex( columnElement.attribute( "index" ), table, column, mappings );
          bindIndex( node.attribute( "index" ), table, column, mappings );
          //column unique-key
          bindUniqueKey( columnElement.attribute( "unique-key" ), table, column, mappings );
          bindUniqueKey( node.attribute( "unique-key" ), table, column, mappings );
        }
        else if ( columnElement.getName().equals( "formula" ) ) {
          Formula formula = new Formula();
          formula.setFormula( columnElement.getText() );
          simpleValue.addFormula( formula );
        }
      }

      // todo : another GoodThing would be to go back after all parsing and see if all the columns
      // (and no formulas) are contained in a defined unique key that only contains these columns.
      // That too would mark this as a logical one-to-one
      final Attribute uniqueAttribute = node.attribute( "unique" );
      if ( uniqueAttribute != null
          && "true".equals( uniqueAttribute.getValue() )
          && ManyToOne.class.isInstance( simpleValue ) ) {
        ( (ManyToOne) simpleValue ).markAsLogicalOneToOne();
      }
    }
    else {
      if ( node.elementIterator( "column" ).hasNext() ) {
        throw new MappingException(
          "column attribute may not be used together with <column> subelement" );
      }
      if ( node.elementIterator( "formula" ).hasNext() ) {
        throw new MappingException(
          "column attribute may not be used together with <formula> subelement" );
      }

      Column column = new Column();
      column.setValue( simpleValue );
      bindColumn( node, column, isNullable );
      if ( column.isUnique() && ManyToOne.class.isInstance( simpleValue ) ) {
        ( (ManyToOne) simpleValue ).markAsLogicalOneToOne();
      }
      String columnName = columnAttribute.getValue();
      String logicalColumnName = mappings.getNamingStrategy().logicalColumnName(
          columnName, propertyPath
      );
      columnName = mappings.getNamingStrategy().columnName( columnName );
      columnName = quoteIdentifier( columnName, mappings );
      column.setName( columnName );
      if ( table != null ) {
        table.addColumn( column ); // table=null -> an association - fill
                                   // it in later
        //TODO fill in the mappings for table == null
        mappings.addColumnBinding( logicalColumnName, column, table );
      }
      simpleValue.addColumn( column );
View Full Code Here

      if ( tableNode != null ) {
        tableName = mappings.getNamingStrategy().tableName( tableNode.getValue() );
      }
      else {
        //tableName = mappings.getNamingStrategy().propertyToTableName( className, path );
        Table ownerTable = collection.getOwner().getTable();
        //TODO mappings.getLogicalTableName(ownerTable)
        String logicalOwnerTableName = ownerTable.getName();
        //FIXME we don't have the associated entity table name here, has to be done in a second pass
        tableName = mappings.getNamingStrategy().collectionTableName(
            collection.getOwner().getEntityName(),
            logicalOwnerTableName ,
            null,
            null,
            path
        );
        if ( ownerTable.isQuoted() ) {
          tableName = StringHelper.quote( tableName );
        }
      }
      Attribute schemaNode = node.attribute( "schema" );
      String schema = schemaNode == null ?
          mappings.getSchemaName() : schemaNode.getValue();

      Attribute catalogNode = node.attribute( "catalog" );
      String catalog = catalogNode == null ?
          mappings.getCatalogName() : catalogNode.getValue();

      Table table = mappings.addTable(
          schema,
          catalog,
          tableName,
          getSubselect( node ),
          false
View Full Code Here

  protected static void createClassProperties(Element node, PersistentClass persistentClass,
      Mappings mappings, java.util.Map inheritedMetas, UniqueKey uniqueKey,
      boolean mutable, boolean nullable, boolean naturalId) throws MappingException {

    String entityName = persistentClass.getEntityName();
    Table table = persistentClass.getTable();

    Iterator iter = node.elementIterator();
    while ( iter.hasNext() ) {
      Element subnode = (Element) iter.next();
      String name = subnode.getName();
      String propertyName = subnode.attributeValue( "name" );

      CollectionType collectType = CollectionType.collectionTypeFromString( name );
      Value value = null;
      if ( collectType != null ) {
        Collection collection = collectType.create(
            subnode,
            StringHelper.qualify( entityName, propertyName ),
            persistentClass,
            mappings, inheritedMetas
          );
        mappings.addCollection( collection );
        value = collection;
      }
      else if ( "many-to-one".equals( name ) ) {
        value = new ManyToOne( mappings, table );
        bindManyToOne( subnode, (ManyToOne) value, propertyName, nullable, mappings );
      }
      else if ( "any".equals( name ) ) {
        value = new Any( mappings, table );
        bindAny( subnode, (Any) value, nullable, mappings );
      }
      else if ( "one-to-one".equals( name ) ) {
        value = new OneToOne( mappings, table, persistentClass );
        bindOneToOne( subnode, (OneToOne) value, propertyName, true, mappings );
      }
      else if ( "property".equals( name ) ) {
        value = new SimpleValue( mappings, table );
        bindSimpleValue( subnode, (SimpleValue) value, nullable, propertyName, mappings );
      }
      else if ( "component".equals( name )
        || "dynamic-component".equals( name )
        || "properties".equals( name ) ) {
        String subpath = StringHelper.qualify( entityName, propertyName );
        value = new Component( mappings, persistentClass );

        bindComponent(
            subnode,
            (Component) value,
            persistentClass.getClassName(),
            propertyName,
            subpath,
            true,
            "properties".equals( name ),
            mappings,
            inheritedMetas,
            false
          );
      }
      else if ( "join".equals( name ) ) {
        Join join = new Join();
        join.setPersistentClass( persistentClass );
        bindJoin( subnode, join, mappings, inheritedMetas );
        persistentClass.addJoin( join );
      }
      else if ( "subclass".equals( name ) ) {
        handleSubclass( persistentClass, mappings, subnode, inheritedMetas );
      }
      else if ( "joined-subclass".equals( name ) ) {
        handleJoinedSubclass( persistentClass, mappings, subnode, inheritedMetas );
      }
      else if ( "union-subclass".equals( name ) ) {
        handleUnionSubclass( persistentClass, mappings, subnode, inheritedMetas );
      }
      else if ( "filter".equals( name ) ) {
        parseFilter( subnode, persistentClass, mappings );
      }
      else if ( "natural-id".equals( name ) ) {
        UniqueKey uk = new UniqueKey();
        uk.setTable(table);
        //by default, natural-ids are "immutable" (constant)
        boolean mutableId = "true".equals( subnode.attributeValue("mutable") );
        createClassProperties(
            subnode,
            persistentClass,
            mappings,
            inheritedMetas,
            uk,
            mutableId,
            false,
            true
          );
        uk.setName( Constraint.generateName( uk.generatedConstraintNamePrefix(),
            table, uk.getColumns() ) );
        table.addUniqueKey(uk);
      }
      else if ( "query".equals(name) ) {
        bindNamedQuery(subnode, persistentClass.getEntityName(), mappings);
      }
      else if ( "sql-query".equals(name) ) {
View Full Code Here

    joinSpan = persistentClass.getJoinClosureSpan()+1;
    qualifiedTableNames = new String[joinSpan];
    isInverseTable = new boolean[joinSpan];
    isNullableTable = new boolean[joinSpan];
    keyColumnNames = new String[joinSpan][];
    final Table table = persistentClass.getRootTable();
    qualifiedTableNames[0] = table.getQualifiedName(
        factory.getDialect(),
        factory.getSettings().getDefaultCatalogName(),
        factory.getSettings().getDefaultSchemaName()
    );
    isInverseTable[0] = false;
View Full Code Here

    ArrayList keyColumnReaderTemplates = new ArrayList();
    ArrayList cascadeDeletes = new ArrayList();
    Iterator titer = persistentClass.getTableClosureIterator();
    Iterator kiter = persistentClass.getKeyClosureIterator();
    while ( titer.hasNext() ) {
      Table tab = (Table) titer.next();
      KeyValue key = (KeyValue) kiter.next();
      String tabname = tab.getQualifiedName(
          factory.getDialect(),
          factory.getSettings().getDefaultCatalogName(),
          factory.getSettings().getDefaultSchemaName()
      );
      tables.add( tabname );
      String[] keyCols = new String[idColumnSpan];
      String[] keyColReaders = new String[idColumnSpan];
      String[] keyColReaderTemplates = new String[idColumnSpan];
      Iterator citer = key.getColumnIterator();
      for ( int k = 0; k < idColumnSpan; k++ ) {
        Column column = (Column) citer.next();
        keyCols[k] = column.getQuotedName( factory.getDialect() );
        keyColReaders[k] = column.getReadExpr( factory.getDialect() );
        keyColReaderTemplates[k] = column.getTemplate( factory.getDialect(), factory.getSqlFunctionRegistry() );
      }
      keyColumns.add( keyCols );
      keyColumnReaders.add( keyColReaders );
      keyColumnReaderTemplates.add( keyColReaderTemplates );
      cascadeDeletes.add( key.isCascadeDeleteEnabled() && factory.getDialect().supportsCascadeDelete() );
    }

    //Span of the tables directly mapped by this entity and super-classes, if any
    coreTableSpan = tables.size();

    isNullableTable = new boolean[persistentClass.getJoinClosureSpan()];

    int tableIndex = 0;
    Iterator joinIter = persistentClass.getJoinClosureIterator();
    while ( joinIter.hasNext() ) {
      Join join = (Join) joinIter.next();

      isNullableTable[tableIndex++] = join.isOptional();

      Table table = join.getTable();

      String tableName = table.getQualifiedName(
          factory.getDialect(),
          factory.getSettings().getDefaultCatalogName(),
          factory.getSettings().getDefaultSchemaName()
      );
      tables.add( tableName );

      KeyValue key = join.getKey();
      int joinIdColumnSpan = key.getColumnSpan();

      String[] keyCols = new String[joinIdColumnSpan];
      String[] keyColReaders = new String[joinIdColumnSpan];
      String[] keyColReaderTemplates = new String[joinIdColumnSpan];

      Iterator citer = key.getColumnIterator();

      for ( int k = 0; k < joinIdColumnSpan; k++ ) {
        Column column = (Column) citer.next();
        keyCols[k] = column.getQuotedName( factory.getDialect() );
        keyColReaders[k] = column.getReadExpr( factory.getDialect() );
        keyColReaderTemplates[k] = column.getTemplate( factory.getDialect(), factory.getSqlFunctionRegistry() );
      }
      keyColumns.add( keyCols );
      keyColumnReaders.add( keyColReaders );
      keyColumnReaderTemplates.add( keyColReaderTemplates );
      cascadeDeletes.add( key.isCascadeDeleteEnabled() && factory.getDialect().supportsCascadeDelete() );
    }

    naturalOrderTableNames = ArrayHelper.toStringArray( tables );
    naturalOrderTableKeyColumns = ArrayHelper.to2DStringArray( keyColumns );
    naturalOrderTableKeyColumnReaders = ArrayHelper.to2DStringArray( keyColumnReaders );
    naturalOrderTableKeyColumnReaderTemplates = ArrayHelper.to2DStringArray( keyColumnReaderTemplates );
    naturalOrderCascadeDeleteEnabled = ArrayHelper.toBooleanArray( cascadeDeletes );

    ArrayList subtables = new ArrayList();
    ArrayList isConcretes = new ArrayList();
    ArrayList isDeferreds = new ArrayList();
    ArrayList isLazies = new ArrayList();

    keyColumns = new ArrayList();
    titer = persistentClass.getSubclassTableClosureIterator();
    while ( titer.hasNext() ) {
      Table tab = (Table) titer.next();
      isConcretes.add( persistentClass.isClassOrSuperclassTable( tab ) );
      isDeferreds.add( Boolean.FALSE );
      isLazies.add( Boolean.FALSE );
      String tabname = tab.getQualifiedName(
          factory.getDialect(),
          factory.getSettings().getDefaultCatalogName(),
          factory.getSettings().getDefaultSchemaName()
      );
      subtables.add( tabname );
      String[] key = new String[idColumnSpan];
      Iterator citer = tab.getPrimaryKey().getColumnIterator();
      for ( int k = 0; k < idColumnSpan; k++ ) {
        key[k] = ( (Column) citer.next() ).getQuotedName( factory.getDialect() );
      }
      keyColumns.add( key );
    }

    //Add joins
    joinIter = persistentClass.getSubclassJoinClosureIterator();
    while ( joinIter.hasNext() ) {
      Join join = (Join) joinIter.next();

      Table tab = join.getTable();

      isConcretes.add( persistentClass.isClassOrSuperclassTable( tab ) );
      isDeferreds.add( join.isSequentialSelect() );
      isLazies.add( join.isLazy() );

      String tabname = tab.getQualifiedName(
          factory.getDialect(),
          factory.getSettings().getDefaultCatalogName(),
          factory.getSettings().getDefaultSchemaName()
      );
      subtables.add( tabname );
      String[] key = new String[idColumnSpan];
      Iterator citer = tab.getPrimaryKey().getColumnIterator();
      for ( int k = 0; k < idColumnSpan; k++ ) {
        key[k] = ( (Column) citer.next() ).getQuotedName( factory.getDialect() );
      }
      keyColumns.add( key );
    }

    String[] naturalOrderSubclassTableNameClosure = ArrayHelper.toStringArray( subtables );
    String[][] naturalOrderSubclassTableKeyColumnClosure = ArrayHelper.to2DStringArray( keyColumns );
    isClassOrSuperclassTable = ArrayHelper.toBooleanArray( isConcretes );
    subclassTableSequentialSelect = ArrayHelper.toBooleanArray( isDeferreds );
    subclassTableIsLazyClosure = ArrayHelper.toBooleanArray( isLazies );

    constraintOrderedTableNames = new String[naturalOrderSubclassTableNameClosure.length];
    constraintOrderedKeyColumnNames = new String[naturalOrderSubclassTableNameClosure.length][];
    int currentPosition = 0;
    for ( int i = naturalOrderSubclassTableNameClosure.length - 1; i >= 0; i--, currentPosition++ ) {
      constraintOrderedTableNames[currentPosition] = naturalOrderSubclassTableNameClosure[i];
      constraintOrderedKeyColumnNames[currentPosition] = naturalOrderSubclassTableKeyColumnClosure[i];
    }

    /**
     * Suppose an entity Client extends Person, mapped to the tables CLIENT and PERSON respectively.
     * For the Client entity:
     * naturalOrderTableNames -> PERSON, CLIENT; this reflects the sequence in which the tables are
     * added to the meta-data when the annotated entities are processed.
     * However, in some instances, for example when generating joins, the CLIENT table needs to be
     * the first table as it will the driving table.
     * tableNames -> CLIENT, PERSON
     */

    tableSpan = naturalOrderTableNames.length;
    tableNames = reverse( naturalOrderTableNames, coreTableSpan );
    tableKeyColumns = reverse( naturalOrderTableKeyColumns, coreTableSpan );
    tableKeyColumnReaders = reverse( naturalOrderTableKeyColumnReaders, coreTableSpan );
    tableKeyColumnReaderTemplates = reverse( naturalOrderTableKeyColumnReaderTemplates, coreTableSpan );
    subclassTableNameClosure = reverse( naturalOrderSubclassTableNameClosure, coreTableSpan );
    subclassTableKeyColumnClosure = reverse( naturalOrderSubclassTableKeyColumnClosure, coreTableSpan );

    spaces = ArrayHelper.join(
        tableNames,
        ArrayHelper.toStringArray( persistentClass.getSynchronizedTables() )
    );

    // Custom sql
    customSQLInsert = new String[tableSpan];
    customSQLUpdate = new String[tableSpan];
    customSQLDelete = new String[tableSpan];
    insertCallable = new boolean[tableSpan];
    updateCallable = new boolean[tableSpan];
    deleteCallable = new boolean[tableSpan];
    insertResultCheckStyles = new ExecuteUpdateResultCheckStyle[tableSpan];
    updateResultCheckStyles = new ExecuteUpdateResultCheckStyle[tableSpan];
    deleteResultCheckStyles = new ExecuteUpdateResultCheckStyle[tableSpan];

    PersistentClass pc = persistentClass;
    int jk = coreTableSpan - 1;
    while ( pc != null ) {
      customSQLInsert[jk] = pc.getCustomSQLInsert();
      insertCallable[jk] = customSQLInsert[jk] != null && pc.isCustomInsertCallable();
      insertResultCheckStyles[jk] = pc.getCustomSQLInsertCheckStyle() == null
          ? ExecuteUpdateResultCheckStyle.determineDefault(
          customSQLInsert[jk], insertCallable[jk]
      )
          : pc.getCustomSQLInsertCheckStyle();
      customSQLUpdate[jk] = pc.getCustomSQLUpdate();
      updateCallable[jk] = customSQLUpdate[jk] != null && pc.isCustomUpdateCallable();
      updateResultCheckStyles[jk] = pc.getCustomSQLUpdateCheckStyle() == null
          ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLUpdate[jk], updateCallable[jk] )
          : pc.getCustomSQLUpdateCheckStyle();
      customSQLDelete[jk] = pc.getCustomSQLDelete();
      deleteCallable[jk] = customSQLDelete[jk] != null && pc.isCustomDeleteCallable();
      deleteResultCheckStyles[jk] = pc.getCustomSQLDeleteCheckStyle() == null
          ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLDelete[jk], deleteCallable[jk] )
          : pc.getCustomSQLDeleteCheckStyle();
      jk--;
      pc = pc.getSuperclass();
    }

    if ( jk != -1 ) {
      throw new AssertionFailure( "Tablespan does not match height of joined-subclass hiearchy." );
    }

    joinIter = persistentClass.getJoinClosureIterator();
    int j = coreTableSpan;
    while ( joinIter.hasNext() ) {
      Join join = (Join) joinIter.next();

      customSQLInsert[j] = join.getCustomSQLInsert();
      insertCallable[j] = customSQLInsert[j] != null && join.isCustomInsertCallable();
      insertResultCheckStyles[j] = join.getCustomSQLInsertCheckStyle() == null
          ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLInsert[j], insertCallable[j] )
          : join.getCustomSQLInsertCheckStyle();
      customSQLUpdate[j] = join.getCustomSQLUpdate();
      updateCallable[j] = customSQLUpdate[j] != null && join.isCustomUpdateCallable();
      updateResultCheckStyles[j] = join.getCustomSQLUpdateCheckStyle() == null
          ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLUpdate[j], updateCallable[j] )
          : join.getCustomSQLUpdateCheckStyle();
      customSQLDelete[j] = join.getCustomSQLDelete();
      deleteCallable[j] = customSQLDelete[j] != null && join.isCustomDeleteCallable();
      deleteResultCheckStyles[j] = join.getCustomSQLDeleteCheckStyle() == null
          ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLDelete[j], deleteCallable[j] )
          : join.getCustomSQLDeleteCheckStyle();
      j++;
    }

    // PROPERTIES
    int hydrateSpan = getPropertySpan();
    naturalOrderPropertyTableNumbers = new int[hydrateSpan];
    propertyTableNumbers = new int[hydrateSpan];
    Iterator iter = persistentClass.getPropertyClosureIterator();
    int i = 0;
    while ( iter.hasNext() ) {
      Property prop = (Property) iter.next();
      String tabname = prop.getValue().getTable().getQualifiedName(
          factory.getDialect(),
          factory.getSettings().getDefaultCatalogName(),
          factory.getSettings().getDefaultSchemaName()
      );
      propertyTableNumbers[i] = getTableId( tabname, tableNames );
      naturalOrderPropertyTableNumbers[i] = getTableId( tabname, naturalOrderTableNames );
      i++;
    }

    // subclass closure properties

    //TODO: code duplication with SingleTableEntityPersister

    ArrayList columnTableNumbers = new ArrayList();
    ArrayList formulaTableNumbers = new ArrayList();
    ArrayList propTableNumbers = new ArrayList();

    iter = persistentClass.getSubclassPropertyClosureIterator();
    while ( iter.hasNext() ) {
      Property prop = (Property) iter.next();
      Table tab = prop.getValue().getTable();
      String tabname = tab.getQualifiedName(
          factory.getDialect(),
          factory.getSettings().getDefaultCatalogName(),
          factory.getSettings().getDefaultSchemaName()
      );
      Integer tabnum = getTableId( tabname, subclassTableNameClosure );
View Full Code Here

    return false;
  }

   public boolean isTable(Object key) throws HibernateException {
     if(key instanceof String) {
      Table tbl = new Table((String)key);
      if ( getTableMetadata( tbl.getName(), tbl.getSchema(), tbl.getCatalog(), tbl.isQuoted() ) != null ) {
         return true;
       } else {
         String[] strings = StringHelper.split(".", (String) key);
         if(strings.length==3) {
          tbl = new Table(strings[2]);
          tbl.setCatalog(strings[0]);
          tbl.setSchema(strings[1]);
          return getTableMetadata( tbl.getName(), tbl.getSchema(), tbl.getCatalog(), tbl.isQuoted() ) != null;
         } else if (strings.length==2) {
          tbl = new Table(strings[1]);
          tbl.setSchema(strings[0]);
          return getTableMetadata( tbl.getName(), tbl.getSchema(), tbl.getCatalog(), tbl.isQuoted() ) != null;
         }
       }
     }
     return false;
   }
View Full Code Here

      Object columnOwner,
      Ejb3JoinColumn[] columns,
      Mappings mappings) {
    Map<Column, Set<Property>> columnsToProperty = new HashMap<Column, Set<Property>>();
    List<Column> orderedColumns = new ArrayList<Column>( columns.length );
    Table referencedTable = null;
    if ( columnOwner instanceof PersistentClass ) {
      referencedTable = ( (PersistentClass) columnOwner ).getTable();
    }
    else if ( columnOwner instanceof Join ) {
      referencedTable = ( (Join) columnOwner ).getTable();
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.Table

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.