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()
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()
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)