Examples of FieldDefinition


Examples of oracle.toplink.essentials.tools.schemaframework.FieldDefinition

                fields = allFields;
            }
            Iterator itFields = fields.iterator();
            while(itFields.hasNext()) {
                DatabaseField field = (DatabaseField)itFields.next();
                FieldDefinition fieldDef;
                //bug3307, should use columnDefinition if it was defined.
                if(field.getColumnDefinition().length() == 0){
                   fieldDef = new FieldDefinition(field.getName(), ConversionManager.getObjectClass(field.getType()));
                }else{
                   fieldDef = new FieldDefinition(field.getName(), field.getColumnDefinition());
                }
                if(pkFields.contains(field) && shouldTempTableSpecifyPrimaryKeys()) {
                    fieldDef.setIsPrimaryKey(true);
                }
                tableDef.addField(fieldDef);
            }           
            tableDef.setCreationPrefix(getCreateTempTableSqlPrefix());
            tableDef.setName(getTempTableForTable(table).getQualifiedName());
View Full Code Here

Examples of org.apache.cocoon.components.search.fieldmodel.FieldDefinition

     * @param value
     *            String value
     */
    public Field createField(String fieldname, String value)
            throws IndexException {
        FieldDefinition f = structure.getFieldDef(fieldname);
        if (f == null) {
            throw new IndexException("Field with the name: " + fieldname
                    + " doesn't exist");
        }
        return f.createLField(value);
    }
View Full Code Here

Examples of org.b3log.latke.repository.jdbc.util.FieldDefinition

        }

        final Map<String, List<FieldDefinition>> map = new HashMap<String, List<FieldDefinition>>();
        final List<FieldDefinition> dList = new ArrayList<FieldDefinition>();

        FieldDefinition definition = new FieldDefinition();
        definition.setName("oId");
        definition.setIsKey(true);
        definition.setType("String");
        dList.add(definition);

        definition = new FieldDefinition();
        definition.setName("col1");
        definition.setType("int");
        dList.add(definition);

        definition = new FieldDefinition();
        definition.setName("col2");
        definition.setType("String");
        dList.add(definition);

        definition = new FieldDefinition();
        definition.setName("col3");
        definition.setType("double");
        dList.add(definition);

        definition = new FieldDefinition();
        definition.setName("col4");
        definition.setType("boolean");
        dList.add(definition);

        map.put("basetable", dList);
        JdbcRepositories.setRepositoriesMap(map);
    }
View Full Code Here

Examples of org.broadleafcommerce.cms.field.domain.FieldDefinition

                //This may either be an ASSET_LOOKUP image path or an HTML block (with multiple <img>) or a plain STRING that contains the cmsPrefix.
                //If there is an environment prefix configured (e.g. a CDN), then we must replace the cmsPrefix with this one.
                String fldValue = staticAssetPathService.convertAllAssetPathsInContent(originalValue, secure);
                scDTO.getValues().put(fieldKey, fldValue);
            } else {
                FieldDefinition definition = null;
                Iterator<FieldGroup> groupIterator = sc.getStructuredContentType().getStructuredContentFieldTemplate().getFieldGroups().iterator();
                while (groupIterator.hasNext() && definition == null) {
                    FieldGroup group = groupIterator.next();
                    for (FieldDefinition def : group.getFieldDefinitions()) {
                        if (def.getName().equals(fieldKey)) {
                            definition = def;
                            break;
                        }
                    }
                }

                if (definition != null) {
                    Object value = null;
                    if (originalValue != null) {
                        switch (definition.getFieldType()) {
                            case DATE:
                                try {
                                    value = FormatUtil.getDateFormat().parse(originalValue);
                                } catch (Exception e) {
                                    value = originalValue;
View Full Code Here

Examples of org.drools.core.factmodel.FieldDefinition

                        null,
                        "Unable to find @positional field " + descr.getPosition() + " for class " + tDecl.getTypeName() + "\n"));
                return;
            }

            FieldDefinition field = clsDef.getField( descr.getPosition() );
            if ( field == null ) {
                context.addError(new DescrBuildError(context.getParentDescr(),
                        descr,
                        null,
                        "Unable to find @positional field " + descr.getPosition() + " for class " + tDecl.getTypeName() + "\n"));
                return;
            }

            String expr = descr.getExpression();
            boolean isSimpleIdentifier = isIdentifier(expr);

            if ( isSimpleIdentifier ) {
                // create a binding
                BindingDescr binder = new BindingDescr();
                binder.setUnification( true );
                binder.setExpression( field.getName() );
                binder.setVariable( descr.getExpression() );
                buildRuleBindings( context,
                                   patternDescr,
                                   pattern,
                                   binder );
            } else {
                // create a constraint
                build( context,
                       patternDescr,
                       pattern,
                       descr,
                       field.getName() + " == " + descr.getExpression() );
            }
        }
    }
View Full Code Here

Examples of org.drools.core.factmodel.FieldDefinition

            PriorityQueue<FieldDefinition> fieldDefs = sortFields( typeDescr.getFields(),
                                                                   pkgRegistry.getTypeResolver(),
                                                                   kbuilder );
            int n = fieldDefs.size();
            for (int k = 0; k < n; k++) {
                FieldDefinition fld = fieldDefs.poll();
                fld.setIndex( k );
                def.addField( fld );
            }
        }
        return true;
    }
View Full Code Here

Examples of org.drools.core.factmodel.FieldDefinition

            String fullFieldType = kbuilder != null ?
                                   TypeDeclarationUtils.toBuildableType( typeNameKey, kbuilder.getRootClassLoader() ) :
                                   typeNameKey;

            FieldDefinition fieldDef = new FieldDefinition( field.getFieldName(),
                                                            fullFieldType );
            // field is marked as PK
            boolean isKey = field.getAnnotation(TypeDeclaration.ATTR_KEY) != null;
            fieldDef.setKey( isKey );

            fieldDef.setDeclIndex( field.getIndex() );
            if (field.getIndex() < 0) {
                int freePos = occupiedPositions.nextClearBit(0);
                if (freePos < maxDeclaredPos) {
                    occupiedPositions.set(freePos);
                } else {
                    freePos = maxDeclaredPos + 1;
                }
                fieldDef.setPriority(freePos * 256 + curr++);
            } else {
                fieldDef.setPriority(field.getIndex() * 256 + curr++);
            }
            fieldDef.setInherited( field.isInherited() );
            fieldDef.setRecursivefield.isRecursive() );
            fieldDef.setInitExpr( TypeDeclarationUtils.rewriteInitExprWithImports( field.getInitExpr(), typeResolver ) );

            for (String annotationName : field.getAnnotationNames()) {
                Class annotation = TypeDeclarationUtils.resolveAnnotation( annotationName,
                                                                           typeResolver );
                if (annotation != null && annotation.isAnnotation()) {
                    try {
                        AnnotationDefinition annotationDefinition = AnnotationDefinition.build( annotation,
                                                                                                field.getAnnotations().get( annotationName ).getValueMap(),
                                                                                                typeResolver );
                        fieldDef.addAnnotation( annotationDefinition );
                    } catch ( NoSuchMethodException nsme ) {

                        kbuilder.addBuilderResult( new TypeDeclarationError( field,
                                                                             "Annotated field " + field.getFieldName() +
                                                                             "  - undefined property in @annotation " +
                                                                             annotationName + ": " + nsme.getMessage() + ";" ) );
                    }
                }
                if (annotation == null || annotation == Key.class || annotation == Position.class) {
                    fieldDef.addMetaData(annotationName, field.getAnnotation(annotationName).getSingleValue());
                }
            }

            queue.add(fieldDef);

View Full Code Here

Examples of org.drools.core.factmodel.FieldDefinition

                PriorityQueue<FieldDefinition> fieldDefs = sortFields( fields,
                                                                       null,
                                                                       null );
                int n = fieldDefs.size();
                for (int k = 0; k < n; k++) {
                    FieldDefinition fld = fieldDefs.poll();
                    fld.setIndex( k );
                    def.addField( fld );
                }
            }

            Set<String> interfaces = new HashSet<String>();
View Full Code Here

Examples of org.drools.core.factmodel.FieldDefinition

                if (orderedFields[pos.value()] != null) {
                    kbuilder.addBuilderResult(new TypeDeclarationError(typeDeclaration,
                                                                       "Duplicated position " + pos.value() + " for field '" + fld.getName() + "' on class " + cls.getName()));
                    continue;
                }
                FieldDefinition fldDef = clsDef.getField(fld.getName());
                if (fldDef == null) {
                    fldDef = new FieldDefinition(fld.getName(), fld.getType().getName());
                }
                fldDef.setIndex(pos.value());
                orderedFields[ pos.value() ] = fldDef;
            }
        }
        for (FieldDefinition fld : orderedFields) {
            if (fld != null) {
View Full Code Here

Examples of org.drools.core.factmodel.FieldDefinition

            return;
        }

        //add the missing fields (if any) to newDeclaration
        for (FieldDefinition oldFactField : oldDeclaration.getTypeClassDef().getFieldsDefinitions()) {
            FieldDefinition newFactField = newDeclaration.getTypeClassDef().getField(oldFactField.getName());
            if (newFactField == null) {
                newDeclaration.getTypeClassDef().addField(oldFactField);
            }
        }
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.