Package org.voltdb.catalog

Examples of org.voltdb.catalog.ConstraintRef


    public static Column getReferredColumn(Column c)
    {
        CatalogMap<ConstraintRef> crm = c.getConstraints();
        if (crm.isEmpty())
            return null;
        ConstraintRef cr = c.getConstraints().get(0);
        return cr.getConstraint().getForeignkeycols().get(0).getColumn();
    }
View Full Code Here


            catalog_fkey_col_ref.setColumn(catalog_fkey_col);

            //
            // Add the ConstraintRef to the child Column
            //
            ConstraintRef catalog_const_ref = catalog_col.getConstraints().add(catalog_const.getName());
            catalog_const_ref.setConstraint(catalog_const);

            LOG.debug("Added foreign key constraint from '" + catalog_tbl.getName() + "." + column + "' to '" + fkey[0] + "." + fkey[1] + "'");
            table_const_map.put(catalog_fkey_tbl, catalog_const);
        } // FOR
        return;
View Full Code Here

                    if (!src_conref.getConstraint().equals(src_cons))
                        continue;
                    CatalogCloner.clone(src_conref, dest_catalog);

                    // Correct what it's pointing to
                    ConstraintRef dest_conref = dest_col.getConstraints().get(src_conref.getName());
                    assert (dest_conref != null);
                    // System.out.println("dest_tbl: " + dest_tbl);
                    // System.out.println("dest_tbl.getConstraints(): " +
                    // CatalogUtil.debug(dest_tbl.getConstraints()));
                    // System.out.println("src_confref: " + src_conref);
                    // System.out.println("src_confref.getConstraint(): " +
                    // src_conref.getConstraint());
                    dest_conref.setConstraint(dest_tbl.getConstraints().get(src_conref.getConstraint().getName()));
                } // FOR
            } // FOR

            Index src_index = src_cons.getIndex();
            if (src_index != null) {
View Full Code Here

                    this.checkFields(generic_class, child0, child1);
                } // FOR
            }
            // ConstraintRefs
            else if (field_val0 instanceof ConstraintRef) {
                ConstraintRef ref0 = (ConstraintRef) field_val0;
                ConstraintRef ref1 = (ConstraintRef) field_val1;
                if (debug)
                    System.err.println(CatalogUtil.getDisplayName(ref0) + " <-> " + CatalogUtil.getDisplayName(ref1));
                this.checkFields(Column.class, ref0.getConstraint(), ref1.getConstraint());
            }
            // TableRefs
            else if (field_val0 instanceof TableRef) {
                TableRef ref0 = (TableRef) field_val0;
                TableRef ref1 = (TableRef) field_val1;
                if (debug)
                    System.err.println(CatalogUtil.getDisplayName(ref0) + " <-> " + CatalogUtil.getDisplayName(ref1));
                this.checkFields(Table.class, ref0.getTable(), ref1.getTable());
            }
            // ColumnRefs
            else if (field_val0 instanceof ColumnRef) {
                ColumnRef ref0 = (ColumnRef) field_val0;
                ColumnRef ref1 = (ColumnRef) field_val1;
                if (debug)
                    System.err.println(CatalogUtil.getDisplayName(ref0) + " <-> " + CatalogUtil.getDisplayName(ref1));
                this.checkFields(Column.class, ref0.getColumn(), ref1.getColumn());
            }
            // CatalogMap
            else if (field_val0 != null && ClassUtil.getSuperClasses(field_val0.getClass()).contains(CatalogType.class)) {
                CatalogType type0 = (CatalogType) field_val0;
                CatalogType type1 = (CatalogType) field_val1;
View Full Code Here

                    // We store the name of from_olumn as the name of the reference in the catalog
                    ColumnRef cref = catalog_const.getForeignkeycols().add(from_col.getTypeName());
                    cref.setColumn(to_col);

                    // Add a ConstraintRef for the from_column
                    ConstraintRef const_ref = from_col.getConstraints().add(catalog_const.getTypeName());
                    const_ref.setConstraint(catalog_const);
                }
            }
        // All other constraints
        } else {
            // Nothing for now...
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.ConstraintRef

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.