Package com.mobixess.jodb.query.api

Examples of com.mobixess.jodb.query.api.Predicate


            Class syntheticPredicateSubjectClass = loader.loadClass(predicateSubjectClass.getName());
            SyntheticSubject syntheticSubject  = new SyntheticSubject(context, loader,syntheticPredicateSubjectClass);
           
            Class syntheticPredicateClass = loader.loadClass(predicate.getClass().getName());
            Predicate syntheticPredicate  = (Predicate) instantiateSyntheticPredicate(session, predicate, syntheticPredicateClass);// (Predicate)syntheticPredicateClass.newInstance();
           
            Comparator syntheticComparator = null;
            if(comparator!=null){
                Class syntheticComparatorClass = loader.loadClass(comparator.getClass().getName());
                syntheticComparator = (Comparator) instantiateSyntheticPredicate(session, comparator, syntheticComparatorClass);
                //(Comparator) session.getDescriptorForClass(syntheticComparatorClass).newInstance();
            }
           
            //int[] predicateSubjectFields = loader.getPredicateSubjectFields();
            JODBIndexingRootAgent indexingRootAgent = session.getIndexingRootAgent();
            JODBIndexingAgent indexingAgent = null;
            Iterator<Integer> predicateSubjectAccessedFields = loader.getAccessedPredicateSubjectFields();
            while (predicateSubjectAccessedFields.hasNext() && indexingAgent == null) {
                indexingAgent = indexingRootAgent.getIndexingAgent(predicateSubjectAccessedFields.next(), session.getBase());
            }
            ByteBuffer indexDataBuffer = null;
            int indexField = -1;
            IndexDataIterator indexIterator = null;
            if(indexingAgent!=null){
                indexField = indexingAgent.getFieldId();
                indexDataBuffer = ByteBuffer.allocate(16);
                indexIterator = indexingAgent.getIndexIterator(true);
            }
           
            if(indexIterator==null){
                indexIterator = new LArrayIndexIterator(base.getForAllObjects(ticket));
            }

            SyntheticSubject syntheticSubjectPrev = null;
            COMPARISON_STATE comparison_state= COMPARISON_STATE.UNKNOWN;
            LArrayChunkedBuffer acceptedIdsBuffer = new LArrayChunkedBuffer();
            while (indexIterator.hasNext()) {
                if(indexDataBuffer != null){
                    indexDataBuffer.clear();
                }
                long nextObjectId = indexIterator.next(indexDataBuffer);

                if(!syntheticSubject.setObjectData(nextObjectId, indexField, indexDataBuffer)){
                    continue;
                }

                if(!syntheticPredicate.match(syntheticSubject._syntheticSubject)){
                    continue;
                }
                acceptedIdsBuffer.add(nextObjectId);
                if(syntheticComparator!=null && comparison_state!=COMPARISON_STATE.MIXED){
                    if(syntheticSubjectPrev!=null ){
View Full Code Here


       
        @SuppressWarnings("unchecked")
        public boolean isOptimizedQuery( String predicateClassName, String comparatorClassName)throws IOException
        {
            JODBSession session = _sessionContainer.getSession();
            Predicate predicate;
            Comparator comparator = null;
            try {
                ClassDescriptor predicateClassDescriptor = session.getDescriptorForClass(predicateClassName);
                predicate = (Predicate) predicateClassDescriptor.newInstance();
                if (comparatorClassName != null) {
View Full Code Here

        @SuppressWarnings("unchecked")
        public IServerQueryResult query( String predicateClassName, String comparatorClassName)throws IOException
        {
            JODBSession session = _sessionContainer.getSession();
            Predicate predicate;
            Comparator comparator = null;
            try {
                ClassDescriptor predicateClassDescriptor = session.getDescriptorForClass(predicateClassName);
                predicate = (Predicate) predicateClassDescriptor.newInstance();
                if (comparatorClassName != null) {
View Full Code Here

TOP

Related Classes of com.mobixess.jodb.query.api.Predicate

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.