Examples of ConstraintType


Examples of org.drools.spi.Constraint.ConstraintType

            if ( !declarations[i].isGlobal() && declarations[i].getPattern() != this ) {
                isAlphaConstraint = false;
            }
        }

        ConstraintType type = isAlphaConstraint ? ConstraintType.ALPHA : ConstraintType.BETA;
        constraint.setType( type );
    }
View Full Code Here

Examples of org.drools.spi.Constraint.ConstraintType

            if ( !declarations[i].isGlobal() && declarations[i].getPattern() != this ) {
                isAlphaConstraint = false;
            }
        }

        ConstraintType type = isAlphaConstraint ? ConstraintType.ALPHA : ConstraintType.BETA;
        constraint.setType( type );
    }
View Full Code Here

Examples of org.drools.spi.Constraint.ConstraintType

            if ( !declarations[i].isGlobal() && declarations[i].getPattern() != container ) {
                isAlphaConstraint = false;
            }
        }

        ConstraintType type = isAlphaConstraint ? ConstraintType.ALPHA : ConstraintType.BETA;
        constraint.setType( type );
    }
View Full Code Here

Examples of org.drools.spi.Constraint.ConstraintType

            if ( !declarations[i].isGlobal() && declarations[i].getPattern() != container ) {
                isAlphaConstraint = false;
            }
        }

        ConstraintType type = isAlphaConstraint ? ConstraintType.ALPHA : ConstraintType.BETA;
        constraint.setType( type );
    }
View Full Code Here

Examples of org.drools.spi.Constraint.ConstraintType

            if ( !declarations[i].isGlobal() && declarations[i].getPattern() != container ) {
                isAlphaConstraint = false;
            }
        }

        ConstraintType type = isAlphaConstraint ? ConstraintType.ALPHA : ConstraintType.BETA;
        constraint.setType( type );
    }
View Full Code Here

Examples of org.jboss.forge.addon.javaee.validation.ConstraintType

   @Override
   public void initializeUI(UIBuilder builder) throws Exception
   {
      UIContext context = builder.getUIContext();
      ConstraintType constraintType = (ConstraintType) context.getAttributeMap().get(ConstraintType.class);
      generateConstraintInputs(builder, constraintType.getConstraint());
   }
View Full Code Here

Examples of org.jboss.forge.addon.javaee.validation.ConstraintType

   {
      UIContext uiContext = context.getUIContext();
      Map<Object, Object> attributeMap = uiContext.getAttributeMap();
      PropertySource<JavaClassSource> property = (PropertySource<JavaClassSource>) attributeMap
               .get(PropertySource.class);
      ConstraintType constraintType = (ConstraintType) attributeMap.get(ConstraintType.class);
      Boolean onAccessor = (Boolean) attributeMap.get("onAccessor");
      final AnnotationTargetSource<JavaClassSource, ?> annotationTarget;
      if (onAccessor)
      {
         annotationTarget = property.getAccessor();
      }
      else
      {
         annotationTarget = property.getField();
      }
      Class<? extends Annotation> constraintAnnotation = constraintType.getConstraint();
      AnnotationSource<JavaClassSource> annotation = annotationTarget
               .addAnnotation(constraintAnnotation);
      populateAnnotation(constraintAnnotation, annotation);
      getSelectedProject(context).getFacet(JavaSourceFacet.class).saveJavaSource(annotation.getOrigin());
      return Results.success("Constraint " + constraintAnnotation.getSimpleName() + " successfully configured");
View Full Code Here

Examples of org.voltdb.types.ConstraintType

                assertTrue(sql.indexOf(catalog_col.getTypeName()) != -1);
            }

            // Constraints
            for (Constraint catalog_const : catalog_tbl.getConstraints()) {
                ConstraintType const_type = ConstraintType.get(catalog_const.getType());
                Index catalog_idx = catalog_const.getIndex();
                // 2011-07-15: Skip all foreign keys
                if (catalog_const.getType() == ConstraintType.FOREIGN_KEY.getValue()) continue;
                assertNotNull("Missing index for " + catalog_const.fullName(), catalog_idx);
                List<ColumnRef> columns = CatalogUtil.getSortedCatalogItems(catalog_idx.getColumns(), "index");
View Full Code Here

Examples of org.voltdb.types.ConstraintType

        // In the code below, we will refer to the column that is pointed to by another column
        // in the dependency as the parent, and the column with the fkey constraint as the child
        boolean found = false;
        for (final Constraint catalog_const : cust_table.getConstraints()) {
            final ConstraintType const_type = ConstraintType.get(catalog_const.getType());
            if (const_type == ConstraintType.FOREIGN_KEY) {
                found = true;
                assertEquals(dist_table, catalog_const.getForeignkeytable());
                assertEquals(catalog_const.getForeignkeycols().size(), 2);
View Full Code Here

Examples of org.voltdb.types.ConstraintType

            if (isNullable == false) ret += " NOT NULL";

            // Single-column constraints
            for (ConstraintRef catalog_const_ref : catalog_col.getConstraints()) {
                Constraint catalog_const = catalog_const_ref.getConstraint();
                ConstraintType const_type = ConstraintType.get(catalog_const.getType());
                if (const_type == ConstraintType.FOREIGN_KEY && include_fkeys == false) continue;

                // Check if there is another column in our table with the same constraint
                // If there is, then we need to add it to the end of the table definition
                boolean found = false;
                for (Column catalog_other_col : catalog_tbl.getColumns()) {
                    if (catalog_other_col.equals(catalog_col)) continue;
                    if (catalog_other_col.getConstraints().getIgnoreCase(catalog_const.getTypeName()) != null) {
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    switch (const_type) {
                        case FOREIGN_KEY: {
                            Table catalog_fkey_tbl = catalog_const.getForeignkeytable();
                            Column catalog_fkey_col = null;
                            for (ColumnRef ref : catalog_const.getForeignkeycols()) {
                                catalog_fkey_col = ref.getColumn();
                                break; // Nasty hack to get first item
                            }

                            assert(catalog_fkey_col != null);
                            ret += " REFERENCES " + catalog_fkey_tbl.getTypeName() + " (" + catalog_fkey_col.getTypeName() + ")";
                            skip_constraints.add(catalog_const);
                            break;
                        }
                        default:
                            // Nothing for now
                    }
                }
            }

            add = ",\n";
        }

        // Constraints
        for (Constraint catalog_const : catalog_tbl.getConstraints()) {
            if (skip_constraints.contains(catalog_const)) continue;
            ConstraintType const_type = ConstraintType.get(catalog_const.getType());
            if (const_type == ConstraintType.FOREIGN_KEY && include_fkeys == false) continue;

            // Primary Keys / Unique Constraints
            if (const_type == ConstraintType.PRIMARY_KEY || const_type == ConstraintType.UNIQUE) {
                Index catalog_idx = catalog_const.getIndex();
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.