def buildFetchOneQuery(self, context, store):
     builder = store.newQueryBuilder()
     if self.typ is not None:
         info = AttributeInfo("category", TypeFamily.TEXT, True, None)
         builder.verify(info, MatchOp.CONTAINS, self.typ.typeName)
     if self.predicate is not None:
         self.predicate.interpretQuery(context, builder)
     if self.typ is not None and self.predicate is not None:
         builder.And()
     return builder.build()
Esempio n. 2
0
 def buildFetchManyQuery(self, context, store):
     builder = store.newQueryBuilder()
     builder.setFirst(self.interpretLimit(context, self.first))
     builder.setLast(self.interpretLimit(context, self.last))
     if self.typ is not None:
         info = AttributeInfo("category", TypeFamily.TEXT, True, None)
         builder.verify(info, MatchOp.HAS, self.typ.typeName)
     if self.predicate is not None:
         self.predicate.interpretQuery(context, builder)
     if self.typ is not None and self.predicate is not None:
         builder.And()
     if self.orderBy is not None:
         self.orderBy.interpretQuery(context, builder)
     return builder.build()
Esempio n. 3
0
 def getAttributeInfo(self):
     collection = isinstance(self.itype, ContainerType)
     family = self.itype.itemType.family if collection else self.itype.family
     return AttributeInfo(self.name, family, collection, self.indexTypes)