company logo

Property :: propertyExist - Check property path

The function checks, whether the property path is valid for the property handle.

Since functions as property() throw an exception, when the requested property does not exist, this function might be called before opening subordinated property handles in order to avoid exceptions.

The function does not look for extension properties. In order to check the existence of an extension property, Database::extensionExist() might be called.

Return value:  Success ( bool  )

The value is true when the function was executed successfully. Otherwise the value is set to false.

Implementation details

bool Property  :: propertyExist ( odaba::String &vAccessPath )

The function checks, whether a property with the path passed in vAccessPath is a property defined as sub-property.

// fails because children.name is not a property of person  

  ph.propertyExist("children");

  • vAccessPath - Access path

    An access path may simply refer to an extent or property, but also to a calculated result. Thus, an access path may contain just a name, but also a sequence of path elements separated by '.' in order to refer to far properties or complex operations.

    The access path may start with two dots (.), which indicates, that the path starts in an upper property handle. One dot indicates, that the path starts in the current property handle. This distinction becomes necessary, when a property has the same name as an extent. To access a property in this case, one dot must precede the property name. The first dot can be omitted, when the property name is not an extent name.

    Forcing to a path to start in a parent property handle requires two dots (..), the parents parent three and so on.

    In order to pass no access path, an empty string ( String() ) has to be passed.

    address.street      // property path

    .address.street     // property path

    ..address.street    // address in parent property instance

    children(0).Age()   // operation path

    Person().children() // path property

    children('Anton')   // path property