Examples of Unique


Examples of cascading.pipe.assembly.Unique

    // create an OPERATION split the text into a token stream
    RegexSplitGenerator splitter = new RegexSplitGenerator( new Fields( "token" ), " " );
    Fields outputSelector = new Fields( "uid", "token" );
    tweetPipe = new Each( tweetPipe, new Fields( "text" ), splitter, outputSelector );

    tweetPipe = new Unique( tweetPipe, Fields.ALL );

    RegexFilter filter = new RegexFilter( "^\\S\\S+$" );
    tweetPipe = new Each( tweetPipe, new Fields( "token" ), filter );

    // create PIPEs for left join on the stop words
View Full Code Here

Examples of com.et.ar.annotations.Unique

            clasz = clasz.getSuperclass();
        }
        OrmInfo orm = OrmInfo.getOrmInfo(clasz);
        for(Field f: clasz.getDeclaredFields()){
            f.setAccessible(true);
            Unique v_unique = f.getAnnotation(Unique.class);
            if (v_unique != null){
                UniqueCreateValidator ucv = new UniqueCreateValidator(clasz,orm.table,f.getName(),v_unique);
                try{
                    Object value = f.get(this);
                    if (ucv.validate(value) == false){
View Full Code Here

Examples of com.et.ar.annotations.Unique

            clasz = clasz.getSuperclass();
        }
        OrmInfo orm = OrmInfo.getOrmInfo(clasz);
        for (Field f: clasz.getDeclaredFields()){
            f.setAccessible(true);
            Unique v_unique = f.getAnnotation(Unique.class);
            if (v_unique != null){
                try{
                    Object idValue = OrmInfo.getFieldValue(clasz,orm.id,this);
                    UniqueUpdateValidator uuv = new UniqueUpdateValidator(clasz,orm.table,f.getName(),orm.id,idValue,v_unique);
                    if (uuv.validate(f.get(this)) == false){
View Full Code Here

Examples of com.skyline.energy.annotation.Unique

      }
    }
  }

  private void configUnique(Method method) {
    Unique unique = method.getAnnotation(Unique.class);
    if (unique != null) {
      isUnique = true;
    } else {
      isUnique = false;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Unique

        }

        // look for an existing constraint on these columns
        Table table = cols[0].getTable();
        Unique[] unqs = table.getUniques();
        Unique exist = null;
        for (int i = 0; i < unqs.length; i++) {
            if (unqs[i].columnsMatch(cols)) {
                exist = unqs[i];
                break;
            }
        }

        // remove existing unique?
        if (!_canUnq) {
            if (exist == null)
                return null;
            if (!adapt)
                throw new MetaDataException(_loc.get(prefix
                    + "-unique-exists", context));
            table.removeUnique(exist);
            return null;
        }

        // no defaults; return existing constraint (if any)
        if (tmplate == null && _unq == null)
            return exist;

        MappingRepository repos = (MappingRepository) context.getRepository();
        if (exist != null) {
            if (_unq != null && _unq.isDeferred() && !exist.isDeferred()) {
                Log log = repos.getLog();
                if (log.isWarnEnabled())
                    log.warn(_loc.get(prefix + "-defer-unique", context));
            }
            return exist;
        }

        // dict can't handle unique constraints?
        DBDictionary dict = repos.getDBDictionary();
        if (_unq != null && !dict.supportsUniqueConstraints) {
            Log log = repos.getLog();
            if (log.isWarnEnabled())
                log.warn(_loc.get(prefix + "-unique-support", context));
            return null;
        }

        boolean fill = repos.getMappingDefaults().defaultMissingInfo();
        if (!adapt && !fill && _unq == null)
            return null;

        String name;
        boolean deferred;
        if (_unq != null) {
            name = _unq.getName();
            deferred = _unq.isDeferred();
        } else {
            name = tmplate.getName();
            deferred = tmplate.isDeferred();
        }

        if (deferred && !dict.supportsDeferredConstraints) {
            Log log = repos.getLog();
            if (log.isWarnEnabled())
                log.warn(_loc.get(prefix + "-create-defer-unique",
                    context, dict.platform));
            deferred = false;
        }

        Unique unq = table.addUnique(name);
        unq.setDeferred(deferred);
        unq.setColumns(cols);
        return unq;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Unique

            _unq = null;
            return;
        }

        _canUnq = true;
        _unq = new Unique();
        _unq.setName(unq.getName());
        _unq.setDeferred(unq.isDeferred());
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Unique

     */
    private void setUnique(FieldMapping fm) {
        if (_unique.size() == 2) // i.e. TRUE & FALSE
            getLog().warn(_loc.get("inconsist-col-attrs", fm));
        else if (_unique.contains(UniqueFlag.TRUE))
            fm.getValueInfo().setUnique(new Unique());
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Unique

     */
    private boolean startUniqueConstraint(Attributes attrs)
        throws SAXException {
        Object current = currentElement();
        if (current instanceof ClassMapping && _secondaryTable == null) {
            Unique unique = new Unique();
            pushElement(unique);
            return true;
        }
        return false;
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Unique

     * within a ClassMapping element and <em>not</em> within a secondary
     * table. The stack is popped and the Unique element is added to the
     * ClassMappingInfo.
     */
    private void endUniqueConstraint() {
        Unique unique = (Unique) popElement();
        Object current = currentElement();
        if (current instanceof ClassMapping && _secondaryTable == null)
            ((ClassMapping) current).getMappingInfo().addUnique(unique);
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Unique

     * the current Unique element that resides in the top of the stack.
     */
    private boolean endColumnName() {
        Object current = currentElement();
        if (current instanceof Unique) {
            Unique unique = (Unique) current;
            Column column = new Column();
            column.setName(this.currentText());
            unique.addColumn(column);
            return true;
        }
        return false;
    }
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.