Ans.
data-type: this attribute is used to represent the type of property. It can be primitive (int,double,string) or a collection (list,set,array).
E.g. <property.... data-type="int" .....>
Above code represents a property of type "int"
component-data-type: When you need to represent an array of primitives, this is used in conjunction with "data-type" attribute.
E.g. <property .... component-data-type="int" data-type="array.... >
Therefore above code represents an array of integers.
item-type: When a property stores an item of an item-descriptor, this attribute is used.
Used in case of one-to-one mapping.
E.g. A user having a single homeAddress can be a good example.
In the "user" item-descriptor there could be a property:
<property ...... name="homeAddress" item-type="contactInfo" .....>
Here, "contactInfo" represents an item-descriptor for address, and user can have exactly ONE homeAddress.
component-item-type: Used when a property refers to a collection (array,set,list) of an item of an item-descriptor. Used in case of one-to-many or many-to-many mapping.
This is used in conjunction with data-type.
E.g.
<property ... name="allAddresses" component-item-type="contactInfo" data-type="list"...>
Above property represents a list of "contactInfo" items in the property "allAddresses"
data-type: this attribute is used to represent the type of property. It can be primitive (int,double,string) or a collection (list,set,array).
E.g. <property.... data-type="int" .....>
Above code represents a property of type "int"
component-data-type: When you need to represent an array of primitives, this is used in conjunction with "data-type" attribute.
E.g. <property .... component-data-type="int" data-type="array.... >
Therefore above code represents an array of integers.
item-type: When a property stores an item of an item-descriptor, this attribute is used.
Used in case of one-to-one mapping.
E.g. A user having a single homeAddress can be a good example.
In the "user" item-descriptor there could be a property:
<property ...... name="homeAddress" item-type="contactInfo" .....>
Here, "contactInfo" represents an item-descriptor for address, and user can have exactly ONE homeAddress.
component-item-type: Used when a property refers to a collection (array,set,list) of an item of an item-descriptor. Used in case of one-to-many or many-to-many mapping.
This is used in conjunction with data-type.
E.g.
<property ... name="allAddresses" component-item-type="contactInfo" data-type="list"...>
Above property represents a list of "contactInfo" items in the property "allAddresses"
No comments:
Post a Comment