Package org.alfresco.util.schemacomp
Class DbProperty
- java.lang.Object
-
- org.alfresco.util.schemacomp.DbProperty
-
public class DbProperty extends java.lang.ObjectA pointer to a specific DbObject property and its value (at time of creating the DbProperty object).- Author:
- Matt Ward
-
-
Constructor Summary
Constructors Modifier Constructor Description DbProperty(DbObject dbObject)Construct a pointer to a database object only (no property within).DbProperty(DbObject dbObject, java.lang.String propertyName)Create a DbProperty by supplying the DbObject and the property name.DbProperty(DbObject dbObject, java.lang.String propertyName, int index)Create a DbProperty with an indexed value, e.g.protectedDbProperty(DbObject dbObject, java.lang.String propertyName, int index, boolean useSuppliedValue, java.lang.Object propertyValue)Full constructor allowing control over whether the property name should be indexed (e.g.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)DbObjectgetDbObject()java.lang.StringgetPath()Work backwards from this DbProperty's DbObject to the root object to create a path in the following format:java.lang.StringgetPropertyName()java.lang.ObjectgetPropertyValue()inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
DbProperty
protected DbProperty(DbObject dbObject, java.lang.String propertyName, int index, boolean useSuppliedValue, java.lang.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
public DbProperty(DbObject dbObject)
Construct a pointer to a database object only (no property within).- Parameters:
dbObject- DbObject
-
DbProperty
public DbProperty(DbObject dbObject, java.lang.String propertyName)
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
public DbProperty(DbObject dbObject, java.lang.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.- Parameters:
dbObject- DbObjectpropertyName- Stringindex- int
-
-
Method Detail
-
getDbObject
public DbObject getDbObject()
- Returns:
- the dbObject
-
getPropertyName
public java.lang.String getPropertyName()
- Returns:
- the propertyName
-
getPropertyValue
public java.lang.Object getPropertyValue()
- Returns:
- the propertyValue
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getPath
public java.lang.String 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
-
-