DataProperty Class
A DataProperty describes the metadata for a single property of an EntityType that contains simple data.
Instances of the DataProperty class are constructed automatically during Metadata retrieval. However it is also possible to construct them directly via the constructor.
Item Index
Methods
Methods
<ctor> DataProperty
-
config
Parameters:
-
config
Configuration Object-
[name]
String optionalThe name of this property.
-
[nameOnServer]
String optionalSame as above but the name is that defined on the server. Either this or the 'name' above must be specified. Whichever one is specified the other will be computed using the NamingConvention on the MetadataStore associated with the EntityType to which this will be added.
-
[dataType=DataType.String]
DataType optional -
[complexTypeName]
String optional -
[isNullable=true]
Boolean optional -
[isScalar=true]
Boolean optional -
[defaultValue]
Any optional -
[isPartOfKey=false]
Boolean optional -
[isUnmapped=false]
Boolean optional -
[concurrencyMode]
String optional -
[maxLength]
Integer optionalOnly meaningfull for DataType.String
-
[validators]
Array of Validator optional -
[custom]
Object optional
-
Example:
var lastNameProp = new DataProperty( {
name: "lastName",
dataType: DataType.String,
isNullable: true,
maxLength: 20
});
// assuming personEntityType is a newly constructed EntityType
personEntityType.addProperty(lastNameProperty);
setProperties
-
config
General purpose property set method
Parameters:
-
config
Object[object]
-
[custom]
Object optional
-
Example:
// assume em1 is an EntityManager
var prop = myEntityType.getProperty("myProperty");
prop.setProperties( {
custom: { foo: 7, bar: "test" }
});
Properties
complexTypeName
String
The name of the ComplexType associated with this property; may be null.
readOnly
concurrencyMode
String
Describe this
readOnly
custom
Object
A free form object that can be used to define any custom metadata for this DataProperty.
readOnly
defaultValue
Any
The default value for this property.
readOnly
isComplexProperty
Bool
Whether the contents of this property is an instance of a ComplexType.
readOnly
isDataProperty
Boolean
Is this a DataProperty? - always true here Allows polymorphic treatment of DataProperties and NavigationProperties.
readOnly
isInherited
Boolean
Whether this property is inherited from a base class.
readOnly
isNullable
Boolean
Whether this property is nullable.
readOnly
isPartOfKey
Boolean
Whether this property is a 'key' property.
readOnly
isScalar
Boolean
Whether this property is scalar (i.e., returns a single value).
readOnly
isUnmapped
Boolean
Whether this property is an 'unmapped' property.
readOnly
maxLength
Number
The maximum length for the value of this property.
readOnly
name
String
The name of this property
readOnly
parentType
EntityType | ComplexType
The parent type that this property belongs to - will be either a EntityType or a ComplexType.
readOnly
validators
Array of Validator
The Validators that are associated with this property. Validators can be added and removed from this collection.
readOnly