|
Query & | offset (size_t offset) |
| Sets an offset of what items to start at. This offset is stored for any further calls on the query until changed. Call with offset=0 to reset to the default behavior, i.e. starting from the first element. More...
|
|
Query & | limit (size_t limit) |
| Sets a limit on the number of processed items. This limit is stored for any further calls on the query until changed. Call with limit=0 to reset to the default behavior - zero limit means no limit applied. More...
|
|
std::vector< std::unique_ptr< EntityT > > | find () |
| Finds all objects matching the query. Note: returning a vector of pointers to avoid excessive allocation because we don't know the number of returned objects beforehand. More...
|
|
std::unique_ptr< EntityT > | findFirst () |
| Find the first object matching the query or nullptr if none matches. More...
|
|
std::unique_ptr< EntityT > | findUnique () |
| Find the only object matching the query. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = enable_if_t<PropertyType == OBXPropertyType_String || PropertyType == OBXPropertyType_StringVector>> |
Query & | setParameter (Property< PropertyEntityT, PropertyType > property, const char *value) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = enable_if_t<PropertyType == OBXPropertyType_String || PropertyType == OBXPropertyType_StringVector>> |
Query & | setParameter (Property< PropertyEntityT, PropertyType > property, const std::string &value) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT > |
Query & | setParameter (Property< PropertyEntityT, OBXPropertyType_String > property, const char *const values[], size_t count) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT > |
Query & | setParameter (Property< PropertyEntityT, OBXPropertyType_String > property, const std::vector< const char * > &values) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT > |
Query & | setParameter (Property< PropertyEntityT, OBXPropertyType_String > property, const std::vector< std::string > &values) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT > |
Query & | setParameter (Property< PropertyEntityT, OBXPropertyType_Bool > property, bool value) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = EnableIfIntegerOrRel<PropertyType>> |
Query & | setParameter (Property< PropertyEntityT, PropertyType > property, int64_t value) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = EnableIfIntegerOrRel<PropertyType>> |
Query & | setParameters (Property< PropertyEntityT, PropertyType > property, int64_t valueA, int64_t valueB) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = enable_if_t<PropertyType == OBXPropertyType_Long || PropertyType == OBXPropertyType_Relation>> |
Query & | setParameter (Property< PropertyEntityT, PropertyType > property, const std::vector< int64_t > &values) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = enable_if_t<PropertyType == OBXPropertyType_Int>> |
Query & | setParameter (Property< PropertyEntityT, PropertyType > property, const std::vector< int32_t > &values) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = EnableIfFloating<PropertyType>> |
Query & | setParameter (Property< PropertyEntityT, PropertyType > property, double value) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT , OBXPropertyType PropertyType, typename = EnableIfFloating<PropertyType>> |
Query & | setParameters (Property< PropertyEntityT, PropertyType > property, double valueA, double valueB) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT > |
Query & | setParameter (Property< PropertyEntityT, OBXPropertyType_ByteVector > property, const void *value, size_t size) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
template<typename PropertyEntityT > |
Query & | setParameter (Property< PropertyEntityT, OBXPropertyType_ByteVector > property, const std::vector< uint8_t > &value) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
| QueryBase (Store &store, OBX_query_builder *qb) |
| Builds a query with the parameters specified by the builder. More...
|
|
| QueryBase (const QueryBase &query) |
| Clones the query. More...
|
|
| QueryBase (QueryBase &&source) noexcept |
|
| QueryBase (Store &store, OBX_query_builder *qb) |
| Builds a query with the parameters specified by the builder. More...
|
|
| QueryBase (const QueryBase &query) |
| Clones the query. More...
|
|
| QueryBase (QueryBase &&source) noexcept |
|
virtual | ~QueryBase () |
|
OBX_query * | cPtr () const |
|
QueryBase & | offset (size_t offset) |
| Sets an offset of what items to start at. This offset is stored for any further calls on the query until changed. Call with offset=0 to reset to the default behavior, i.e. starting from the first element. More...
|
|
QueryBase & | limit (size_t limit) |
| Sets a limit on the number of processed items. This limit is stored for any further calls on the query until changed. Call with limit=0 to reset to the default behavior - zero limit means no limit applied. More...
|
|
std::vector< obx_id > | findIds () |
| Returns IDs of all matching objects. More...
|
|
uint64_t | count () |
| Returns the number of matching objects. More...
|
|
size_t | remove () |
| Removes all matching objects from the database & returns the number of deleted objects. More...
|
|
QueryBase & | setParameter (obx_schema_id entityId, obx_schema_id propertyId, const char *value) |
| Change previously set condition value in an existing query - this improves reusability of the query object. More...
|
|
QueryBase & | setParameter (obx_schema_id entityId, obx_schema_id propertyId, const std::string &value) |
|
QueryBase & | setParameter (obx_schema_id entityId, obx_schema_id propertyId, int64_t value) |
|
template<typename EntityT>
class obx::Query< EntityT >
Query allows to find data matching user defined criteria for a entity type. Created by QueryBuilder and typically used with supplying a Cursor.