Package org.ytreza.data

Examples of org.ytreza.data.Filter


    }
  }
 
  public List<ModelTag> getChildrenList() {
    TableTag tableTag = (TableTag) getTableFactory().getTable(ModelName.TAG);
    Filter filter = new Filter();
    filter.add("parent_id", getId());
   
    try {
      return tableTag.getItem(filter);
    } catch (ItemException e) {
      return new ArrayList<ModelTag>();
View Full Code Here


  }

  public List<ModelTag> getTagFor(int id) throws ItemException {
    List<ModelTag> listTag = new ArrayList<ModelTag>();

    Filter filter = new Filter();
    filter.add(ModelTagAndNote.NAME_OBJECT_ID, id);
    filter.add(ModelTagAndNote.NAME_OFFICIAL, true);
   
    for (Origin<ModelTagAndNote> origin : getOrigins(filter)) {
      listTag.add(origin.getItem().getTag());
    }
   
View Full Code Here

  public ItemIterator<T> listIterator(Filter filter) throws ItemException {
    return new ItemIterator<T>(getIdWhere(filter),getTable());
  }

  public ItemIterator<T> listIterator() throws ItemException {
    return listIterator(new Filter());
  }
View Full Code Here

      e.printStackTrace();
    }
  }

  private Filter createFilterForDuplicateTag() {
    Filter filter = new Filter();
    ModelTag parent = getItem().getParent();
    if (parent.isNull()) {
      filter.add("parent_id", -1);
    } else {
      filter.add("parent_id", parent.getId());
    }
   
    filter.add("label", getItem().getLabel());
    return filter;
  }
View Full Code Here

  public TableFactory getTableFactory() {
    return factory;
  }

  protected List<Origin<T>> getAllOrigins() throws ItemException{
    return getOrigins(new Filter());
  }
View Full Code Here

  public T getNewItem() {
    return generator.getNewItem();
  }
 
  public List<Integer> getAllIds() throws ItemException {
    Filter filter = new Filter();
    return strategy.getIdWhere(filter);
  }
View Full Code Here

    }
  }

  private void fillTagList() {
    try {
      Filter filter = new Filter();
      filter.add(ModelTagAndNote.NAME_OBJECT_ID, getId());

      for (ModelTagAndNote tagAndNote : getTableTagAndNote().getItem(filter)) {
        ModelTag tag = tagAndNote.getTag();
       
        if (! tag.isEmpty()) {
View Full Code Here

  }

  private void createMapProxy() {
    mapProxy = new HashMap<Integer, Origin<T>>();
    try {
      for (Origin<T> origin : otherStrategy.getOrigins(new Filter())) {
        mapProxy.put(origin.getId(), origin);
      }
      createMapNeeded = false;
    } catch (ItemException e) {
      // AUTO_TODO Auto-generated catch block
View Full Code Here

  }

  private void removeAllTag() {
    try {
      Table<ModelTagAndNote> tableNoteAndTag = (TableTagForNote) getFactory().getTable(ModelName.NOTE_TAG);
      Filter filter = new Filter();
      filter.add(ModelTagAndNote.NAME_OBJECT_ID, getId());
      tableNoteAndTag.deleteItem(filter);
    } catch (ItemException e) {
      // AUTO_TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of org.ytreza.data.Filter

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.