1.One to Many RelationShip Example:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gsa-template>
<item-descriptor name="stdinfo" display-property="studentName">
<table name="studentInfo" id-column-name="stdid" type="primary">
<property name="stdid" column-name="STUDENT_ID" data-type="String"/>
<property name="studentname" column-name="STUDENT_NAME" data-type="String"/>
<property name="studentage" column-name="STUDENT_AGE" data-type="String"/>
<property name="studentaddress" column-name="STUDENT_ADDRESS" data-type="String"/>
<property name="state" column-name="STATE" item-type="state" ></property>
<property name="city" column-name="CITY" item-type="city" ></property>
</table>
</item-descriptor>
<item-descriptor name="state" display-property="statename">
<table name="stateInfo" id-column-name="stateid" type="primary">
<property name="stateid" column-name="stateid" data-type="String"/>
<property name="statename" column-name="STATE_NAME" data-type="String"/>
</table>
<table name="state_cities" id-column-name="stateid" type="multi">
<property name="cities" column-name="cityid" data-type="set" component-item-type="city"/>
</table>
</item-descriptor>
<item-descriptor name="city" display-property="cityname">
<table name="cityInfo" id-column-name="cityid" type="primary">
<property name="cityid" column-name="cityid" data-type="String"/>
<property name="cityname" column-name="CITY_NAME" data-type="String"/>
</table>
</item-descriptor>
</gsa-template>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gsa-template>
<item-descriptor name="stdinfo" display-property="studentName">
<table name="studentInfo" id-column-name="stdid" type="primary">
<property name="stdid" column-name="STUDENT_ID" data-type="String"/>
<property name="studentname" column-name="STUDENT_NAME" data-type="String"/>
<property name="studentage" column-name="STUDENT_AGE" data-type="String"/>
<property name="studentaddress" column-name="STUDENT_ADDRESS" data-type="String"/>
<property name="state" column-name="STATE" item-type="state" ></property>
<property name="city" column-name="CITY" item-type="city" ></property>
</table>
</item-descriptor>
<item-descriptor name="state" display-property="statename">
<table name="stateInfo" id-column-name="stateid" type="primary">
<property name="stateid" column-name="stateid" data-type="String"/>
<property name="statename" column-name="STATE_NAME" data-type="String"/>
</table>
<table name="state_cities" id-column-name="stateid" type="multi">
<property name="cities" column-name="cityid" data-type="set" component-item-type="city"/>
</table>
</item-descriptor>
<item-descriptor name="city" display-property="cityname">
<table name="cityInfo" id-column-name="cityid" type="primary">
<property name="cityid" column-name="cityid" data-type="String"/>
<property name="cityname" column-name="CITY_NAME" data-type="String"/>
</table>
</item-descriptor>
</gsa-template>
No comments:
Post a Comment