Package org.jdbf.engine.criteria

Examples of org.jdbf.engine.criteria.Criteria


    public Criteria createClauseOnPk(String repositoryName,RepositoryView view,
                       PrimaryKey primaryKey) {

        PrimaryKeyMap pk = view.getBeanDescriptor().getPrimaryKeyMap();
        ArrayList keys = (ArrayList) pk.getPrimaryKey();
        Criteria criteria = new Criteria(repositoryName);

        for (int i = 0; i < keys.size(); i++) {

            Criteria internal = null;
            if (i > 0)
                internal = new Criteria(repositoryName);

            ItemDescriptor item = (ItemDescriptor) keys.get(i);
            Object value = primaryKey.getValueKey(item.getPropertyName());
            String columnName = item.getPropertyName();

            if (i == 0)
                criteria.addSelectEqualTo(columnName, value);
            else
                internal.addSelectEqualTo(columnName, value);

            if (i > 0)
                criteria.addAndCriteria(internal);
        }
        return criteria;
View Full Code Here


   */
    protected Criteria createClauseOnPk(String repositoryName,RepositoryView view){
   
    PrimaryKeyMap pk = view.getBeanDescriptor().getPrimaryKeyMap();     
    ArrayList keys = (ArrayList)pk.getPrimaryKey()
    Criteria criteria = new Criteria(repositoryName);
 
    for(int i = 0; i < keys.size(); i++){
   
      Criteria internal = null;
      if(i > 0)
        internal = new Criteria(repositoryName);       
     
      ItemDescriptor item = (ItemDescriptor)keys.get(i);
     
      String columnName = item.getPropertyName();
   
      if(i == 0)
        criteria.addSelectEqualTo(columnName,new Character('?'));
      else          
        internal.addSelectEqualTo(columnName,new Character('?'));
   
      if(i > 0)
        criteria.addAndCriteria(internal);                    
    }
   
View Full Code Here

TOP

Related Classes of org.jdbf.engine.criteria.Criteria

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.