Examples of TableDef


Examples of cascading.lingual.catalog.TableDef

    Optiq.writeSQLPlan( properties, flowFactory.getName(), getVolcanoPlanner() );

    for( Ref head : branch.heads.keySet() )
      {
      TableDef tableDefFor = getTableDefFor( platformBroker, head );
      String[] jarPath = ClassLoaderUtil.getJarPaths( getPlatformBroker(), tableDefFor );

      flowFactory.addSource( head.name, tableDefFor, jarPath );
      }

    FlowListener flowListener = null;

    if( branch.tailTableDef != null )
      {
      TableDef tableDef = branch.tailTableDef;
      String[] jarPath = ClassLoaderUtil.getJarPaths( getPlatformBroker(), tableDef );

      flowFactory.addSink( tableDef.getName(), tableDef, jarPath );
      }
    else
      {
      Resource<Protocol, Format, SinkMode> resource = createResultResource( platformBroker, flowFactory );
View Full Code Here

Examples of cascading.lingual.catalog.TableDef

  private void writeValuesTuple( PlatformBroker platformBroker, Ref head ) throws IOException
    {
    SchemaCatalogManager catalog = platformBroker.getCatalogManager();
    String identifier = getIdentifierFor( platformBroker, head );

    TableDef tableDef = createTableFor( catalog, head, identifier );

    TupleEntryCollector collector = catalog.createTapFor( tableDef, SinkMode.KEEP ).openForWrite( platformBroker.getFlowProcess() );

    for( List<RexLiteral> values : head.tuples )
      collector.add( EnumerableUtil.createTupleFrom( values ) );
View Full Code Here

Examples of cascading.lingual.catalog.TableDef

    }

  private TupleEntryCollector getTupleEntryCollector( PlatformBroker platformBroker, Branch branch )
    {
    LingualFlowFactory flowFactory = platformBroker.getFlowFactory( branch );
    TableDef tableDef = branch.tailTableDef;
    String[] jarPath = ClassLoaderUtil.getJarPaths( getPlatformBroker(), tableDef );

    flowFactory.addSink( tableDef.getName(), tableDef, jarPath );
    ClassLoader jarLoader = ClassLoaderUtil.getJarClassLoader( platformBroker, flowFactory );

    if( jarLoader != null )
      Thread.currentThread().setContextClassLoader( jarLoader );

    FlowProcess flowProcess = platformBroker.getFlowProcess();
    SchemaCatalogManager schemaCatalog = platformBroker.getCatalogManager();
    Map<String, TupleEntryCollector> cache = platformBroker.getCollectorCache();

    TupleEntryCollector collector;

    try
      {
      String identifier = tableDef.getIdentifier();

      if( cache != null && cache.containsKey( identifier ) )
        {
        LOG.debug( "inserting into (cached): {}", identifier );
        collector = cache.get( identifier );
View Full Code Here

Examples of com.draagon.meta.manager.db.defs.TableDef

      // Create foreign keys for newly created tables
      for( BaseDef def : createdDefs )
      {
        if ( def instanceof TableDef ) {
         
          TableDef table = (TableDef) def;

            log.info( "VALIDATION - CREATING SEQUENCES FOR TABLE " + def );
          createSequences( c, dd, table );
         
            log.info( "VALIDATION - CREATING INDEXES FOR TABLE " + def );
View Full Code Here

Examples of com.draagon.meta.manager.db.defs.TableDef

      }     
    }
    else if ( def instanceof TableDef ) {
     
      // Check if the table exists and is valid
      TableDef table = (TableDef) def;
      if ( !dd.checkTable( c, table ) ) {
     
        // If not, then auto create it or throw a not found exception
        if ( shouldAutoCreate() ) {
          log.info( "VALIDATION - CREATING TABLE " + table );
View Full Code Here

Examples of com.draagon.meta.manager.db.defs.TableDef

      Object o) throws SQLException {
   
    // Check if there is table inheritence going on, and if so create the super table first
    BaseDef base = omdb.getDBDef();
    if ( base instanceof TableDef ) {
      TableDef table = (TableDef) base;
     
      InheritenceDef inheritence = table.getInheritence();
      if ( inheritence != null ) {
        ObjectMappingDB smom = (ObjectMappingDB) omdb.getSuperMapping();
       
        // Set the discriminator values
        if ( inheritence.getDiscriminatorName() != null ) {
View Full Code Here

Examples of com.draagon.meta.manager.db.defs.TableDef

    Expression exp = null;
   
    // Check if there is table inheritence going on, and if so delete the super table first
    BaseDef base = omdb.getDBDef();
    if ( base instanceof TableDef ) {
      TableDef table = (TableDef) base;
     
      InheritenceDef inheritence = table.getInheritence();
      if ( inheritence != null ) {

        ObjectMappingDB smom = (ObjectMappingDB) omdb.getSuperMapping();

        // Setup the key
View Full Code Here

Examples of com.draagon.meta.manager.db.defs.TableDef

    throws SQLException {
       
    // Check if there is table inheritence going on, and if so delete the super table first
    BaseDef base = omdb.getDBDef();
    if ( base instanceof TableDef ) {
      TableDef table = (TableDef) base;
     
      InheritenceDef inheritence = table.getInheritence();
      if ( inheritence != null ) {
        ObjectMappingDB smom = (ObjectMappingDB) omdb.getSuperMapping();

        MetaField rf = omdb.getField( inheritence.getRefColumn() );
        Collection<MetaField> pkeys = new ArrayList<MetaField>();
View Full Code Here

Examples of com.draagon.meta.manager.db.defs.TableDef

      String tableStr = getProperName( base.getNameDef() );
      query.append(tableStr).append( ' ' ).append( prefix );
     
      if ( base instanceof TableDef ) {
       
        TableDef table = (TableDef) base;
        base = null;
       
        InheritenceDef idef = table.getInheritence();     
        if ( idef != null ) {
          base = idef.getRefTable();
          prefix++;
         
          query.append( " LEFT JOIN " );
View Full Code Here

Examples of com.draagon.meta.manager.db.defs.TableDef

      String tableStr = getProperName( base.getNameDef() );
      query.append(tableStr).append( ' ' ).append( prefix );
     
      if ( base instanceof TableDef ) {
       
        TableDef table = (TableDef) base;
        base = null;
       
        InheritenceDef idef = table.getInheritence();     
        if ( idef != null ) {
          base = idef.getRefTable();
          prefix++;
         
          query.append( " LEFT JOIN " );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.