Examples of UniqueIndex


Examples of de.bwaldvogel.mongo.backend.memory.index.UniqueIndex

        indexes.addDocument(indexDescription);

        BSONObject key = (BSONObject) indexDescription.get("key");
        if (key.keySet().equals(Collections.singleton("_id"))) {
            boolean ascending = Utils.normalizeValue(key.get("_id")).equals(Double.valueOf(1.0));
            collection.addIndex(new UniqueIndex("_id", ascending));
            log.info("adding unique _id index for collection {}", collectionName);
        } else if (Utils.isTrue(indexDescription.get("unique"))) {
            if (key.keySet().size() != 1) {
                throw new MongoServerException("Compound unique indices are not yet implemented");
            }

            log.info("adding unique index {} for collection {}", key.keySet(), collectionName);

            final String field = key.keySet().iterator().next();
            boolean ascending = Utils.normalizeValue(key.get(field)).equals(Double.valueOf(1.0));
            collection.addIndex(new UniqueIndex(field, ascending));
        } else {
            // TODO: non-unique non-id indexes not yet implemented
            log.warn("adding non-unique non-id index with key {} is not yet implemented", key);
        }
    }
View Full Code Here

Examples of org.apache.ddlutils.model.UniqueIndex

     
      Unique unique = field.getAnnotation(Unique.class);
      if(unique != null) {
        String[] names = unique.value();
        for (String name : names) {
          UniqueIndex i = uniques.get(name);
          if(i == null) {
            i = new UniqueIndex();
            i.setName(name);
            uniques.put(name, i);
            table.addIndex(i);
          }
          fillIndex(i, field);
        }
View Full Code Here

Examples of org.apache.ddlutils.model.UniqueIndex

              {
                  index = new NonUniqueIndex();
              }
              else
              {
                  index = new UniqueIndex();
              }

              index.setName(indexName);
              knownIndices.put(indexName, index);
          }
View Full Code Here

Examples of org.apache.ddlutils.model.UniqueIndex

            // Unique Index
            // DDLUtils doesn't yet to UNIQUE constraints.. Hmph
            // --------------------------

            if ( columnDefinition.mIsUnique ) {
                UniqueIndex uniqueIndex = new UniqueIndex();
                uniqueIndex.setName("uidx_" + t.getName() + "_" + c.getName());
                uniqueIndex.addColumn(new IndexColumn(c));
                t.addIndex(uniqueIndex);
            }

            // --------------------------
            // References Constraint
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.unique.UniqueIndex

                            .getChildBuilder(INDEX_CONTENT);
                    queryIndexList.add(new PrefixContentIndex(pref));
                }
            }
        }
        queryIndexList.add(new UniqueIndex());
        return queryIndexList;
    }
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.