Package com.dooapp.gaedo.blueprints.indexable

Examples of com.dooapp.gaedo.blueprints.indexable.IndexNames


  public static <Type extends Element> void setIndexedProperty(Graph database, Type entity, String propertyName, Object newValue) {
    Object oldValue = entity.getProperty(propertyName);
    entity.setProperty(propertyName, newValue);
    if(database instanceof IndexableGraph) {
      IndexableGraph indexable = (IndexableGraph) database;
      IndexNames indexName = IndexNames.forElement(entity);
      Index<Type> index = (Index<Type>) indexable.getIndex(indexName.getIndexName(), indexName.getIndexed());
      if(oldValue!=null) {
        index.remove(propertyName, oldValue, entity);
      }
      if(newValue!=null) {
        index.put(propertyName, newValue, entity);
View Full Code Here


   * @param existing element to remove index entries
   */
  public static <Type extends Element> void removeFromIndex(Graph database, Type existing) {
    if (database instanceof IndexableGraph) {
      IndexableGraph indexable = (IndexableGraph) database;
      IndexNames indexName = IndexNames.forElement(existing);
      if(indexName.isUsable()) {
        Index<Type> index = (Index<Type>) indexable.getIndex(indexName.getIndexName(), indexName.getIndexed());
        for(String propertyName : existing.getPropertyKeys()) {
          index.remove(propertyName, existing.getProperty(propertyName), existing);
        }
      }
    }
View Full Code Here

  public static <Type extends Element> void setIndexedProperty(Graph database, Type entity, String propertyName, Object newValue) {
    Object oldValue = entity.getProperty(propertyName);
    entity.setProperty(propertyName, newValue);
    if(database instanceof IndexableGraph) {
      IndexableGraph indexable = (IndexableGraph) database;
      IndexNames indexName = IndexNames.forElement(entity);
      Index<Type> index = (Index<Type>) indexable.getIndex(indexName.getIndexName(), indexName.getIndexed());
      if(oldValue!=null) {
        index.remove(propertyName, oldValue, entity);
      }
      if(newValue!=null) {
        index.put(propertyName, newValue, entity);
View Full Code Here

   * @param existing element to remove index entries
   */
  public static <Type extends Element> void removeFromIndex(Graph database, Type existing) {
    if (database instanceof IndexableGraph) {
      IndexableGraph indexable = (IndexableGraph) database;
      IndexNames indexName = IndexNames.forElement(existing);
      if(indexName.isUsable()) {
        Index<Type> index = (Index<Type>) indexable.getIndex(indexName.getIndexName(), indexName.getIndexed());
        for(String propertyName : existing.getPropertyKeys()) {
          index.remove(propertyName, existing.getProperty(propertyName), existing);
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.dooapp.gaedo.blueprints.indexable.IndexNames

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.