예제 #1
0
 def delete(self, cascade=True):
     # TODO: batch operation
     del_query = CassandraQuery(self.domain,
                                CassandraQuery.OP_BATCH_DELETE,
                                self,
                                cascade=cascade)
     del_query.execute_query()
예제 #2
0
 def filterObj(domain, qObj=None, **predicate_dict):
     query = CassandraQuery(domain, CassandraQuery.OP_SELECT)
     query.add_filter_object(qObj)
     query.add_filter_statements(predicate_dict)
     query.set_fetch_limits(0, 1)
     
     return query.execute_query()
예제 #3
0
 def getObj(domain, row_key):
     query = CassandraQuery(domain, CassandraQuery.OP_SELECT)
     query.set_fetch_limits(row_key, 1)
     
     try:
         ## result is a dict of {column : value}
         result = query.execute_query()
         env = Environment(row_key, result['ownerID'], result['name'], result['category'])
         
         return env
     except Exception, ex:
         print ex
         return None
예제 #4
0
    def getObj(domain, row_key):
        query = CassandraQuery(domain, CassandraQuery.OP_SELECT)
        query.set_fetch_limits(row_key, 1)

        try:
            ## result is a dict of {column : value}
            result = query.execute_query()
            env = Environment(row_key, result['ownerID'], result['name'],
                              result['category'])

            return env
        except Exception, ex:
            print ex
            return None
예제 #5
0
 def filterCollection(domain, offset = 0, limit = 100, qObj = None, **predicate_dict):
     query = CassandraQuery(domain, CassandraQuery.OP_FETCH)
     query.add_filter_object(qObj)
     query.add_filter_statements(predicate_dict)
     query.set_fetch_limits(offset, limit)
     
     return query.execute_query()
예제 #6
0
    def filterCollection(domain,
                         offset=0,
                         limit=100,
                         qObj=None,
                         **predicate_dict):
        query = CassandraQuery(domain, CassandraQuery.OP_FETCH)
        query.add_filter_object(qObj)
        query.add_filter_statements(predicate_dict)
        query.set_fetch_limits(offset, limit)

        return query.execute_query()
예제 #7
0
 def getCollection(domain, offset = 0, limit = 100):
     query = CassandraQuery(domain, CassandraQuery.OP_FETCH)
     query.set_fetch_limits(offset, limit)
     
     return query.execute_query()
예제 #8
0
 def delete(self, cascade = True):
     # TODO: batch operation 
     del_query = CassandraQuery(self.domain, CassandraQuery.OP_BATCH_DELETE, self, cascade=cascade)
     del_query.execute_query()
예제 #9
0
 def save(self):
     # TODO: batch operation
     ins_query = CassandraQuery(self.domain, CassandraQuery.OP_BATCH_INSERT, self)
     ins_query.execute_query()
예제 #10
0
    def getCollection(domain, offset=0, limit=100):
        query = CassandraQuery(domain, CassandraQuery.OP_FETCH)
        query.set_fetch_limits(offset, limit)

        return query.execute_query()
예제 #11
0
 def save(self):
     # TODO: batch operation
     ins_query = CassandraQuery(self.domain, CassandraQuery.OP_BATCH_INSERT,
                                self)
     ins_query.execute_query()
예제 #12
0
 def getObj(domain, row_key):
     query = CassandraQuery(domain, CassandraQuery.OP_SELECT)
     query.set_fetch_limits(row_key, 1)
     
     return query.execute_query()
예제 #13
0
 def delete(self, cascade = True):
     del_query = CassandraQuery(self.domain, CassandraQuery.OP_DELETE, self, cascade = cascade)
     del_query.execute_query()
예제 #14
0
 def save(self):
     ins_query = CassandraQuery(self.domain, CassandraQuery.OP_INSERT, self)
     ins_query.execute_query()