Package org.alfresco.util.schemacomp
Class DbProperty
java.lang.Object
org.alfresco.util.schemacomp.DbProperty
A pointer to a specific DbObject property and its value (at time of creating the DbProperty object).
- Author:
- Matt Ward
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDbProperty(DbObject dbObject) Construct a pointer to a database object only (no property within).DbProperty(DbObject dbObject, String propertyName) Create a DbProperty by supplying the DbObject and the property name.DbProperty(DbObject dbObject, String propertyName, int index) Create a DbProperty with an indexed value, e.g. for propertyName "myCollection" and index 4, the propertyName will be converted to "myCollection[4]" and the propertValue will be populated with the value at index 4 of myCollection.protectedDbProperty(DbObject dbObject, String propertyName, int index, boolean useSuppliedValue, Object propertyValue) Full constructor allowing control over whether the property name should be indexed (e.g. colours[3]), whether the current value of the property should be retrieved automatically or whether to use the supplied value (useful when performing comparisons - construct one with a particular/expected value and construct another with the current value by reflection). -
Method Summary
-
Constructor Details
-
DbProperty
protected DbProperty(DbObject dbObject, String propertyName, int index, boolean useSuppliedValue, Object propertyValue) Full constructor allowing control over whether the property name should be indexed (e.g. colours[3]), whether the current value of the property should be retrieved automatically or whether to use the supplied value (useful when performing comparisons - construct one with a particular/expected value and construct another with the current value by reflection).The public constructors provide a more usable API with select sets of arguments.
- Parameters:
dbObject- DbObjectpropertyName- Stringindex- intuseSuppliedValue- booleanpropertyValue- Object
-
DbProperty
Construct a pointer to a database object only (no property within).- Parameters:
dbObject- DbObject
-
DbProperty
Create a DbProperty by supplying the DbObject and the property name. The value at time of creation will be populate automatically.- Parameters:
dbObject- DbObjectpropertyName- String
-
DbProperty
Create a DbProperty with an indexed value, e.g. for propertyName "myCollection" and index 4, the propertyName will be converted to "myCollection[4]" and the propertValue will be populated with the value at index 4 of myCollection.- Parameters:
dbObject- DbObjectpropertyName- Stringindex- int
-
-
Method Details
-
getDbObject
- Returns:
- the dbObject
-
getPropertyName
- Returns:
- the propertyName
-
getPropertyValue
- Returns:
- the propertyValue
-
hashCode
public int hashCode() -
equals
-
toString
-
getPath
Work backwards from this DbProperty's DbObject to the root object to create a path in the following format:root.child.grandchild[...].property
e.g. myschema.person.age.nullable
This isn't exactly the same as a FQ database object name, for example the property name could be indexed:
e.g. myschema.person.pk_person.columnNames[2]
to reflect the third column name in the primary key named "pk_person" on the person table.
- Returns:
- String path
-