Proposed EAV Branches and Leaves
branches = collection of data that contains a subset of data or other branches
leaves = collection of a data each linked to a branch.
Branches
| branchid | entity | value | branchowner |
| 000000001 | person | 000000000 | |
| 000000002 | person | 000000000 | |
| 000000003 | car | 000000002 | |
| 000000004 | computer | 000000001 |
the first person has a computer
the second person has a car
Leaves
| leafid | entity | value | branchowner |
| 000000001 | id | 002934 | 000000001 |
| 000000002 | lastname | jayme | 000000001 |
| 000000003 | firstname | nathaniel | 000000001 |
| 000000004 | middlename | balucanag | 000000001 |
| 000000005 | model | nissan-2007 | 000000003 |
| 000000006 | color | blue | 000000003 |
| 000000007 | fullname | Peter Pan | 000000002 |
| 000000008 | address | davao city | 000000002 |
| 000000009 | mobilenumber | 091111111 | 000000002 |
| 000000010 | board | AMD-K8 | 000000004 |
| 000000011 | ram | 512mb | 000000004 |
the first person is named
nathaniel balucanag jayme with id 002934
he owns a computer amd-k8 with 512mb
the second person is named
Peter Pan
he lives in davao city
has a mobile number 091111111
he owns a car nissan-2007 with color blue
Attribute / Entity Definition
The definition of the entities shall be placed in an xml file. This will have the advantages of:
- Placing additional entity into the xml file by using any text editor;
- Zero round-trip connection to database for entity-attribute link.
<datamap version="0.1" type="table">
<table name="Leaves">
<field name="leafid"
tagid="leafid"
type="text"
length=""
format=""
required="yes"/>
<field name="entity"
tagid="entity"
type="text"
length=""
format=""
required="yes"/>
<field name="value"
tagid="value"
type="text"
length=""
format=""
required="yes" />
<field name="branchowner"
tagid="branchowner"
type="text"
length=""
format=""
required="yes" />
</table>
<eaventities>
<entity name="id"
tagid="id"
type="text"
length=""
format=""
required="yes" />
<entity name="lastname"
tagid="lastname"
type="text"
length=""
format=""
required="yes" />
<entity name="firstname"
tagid="firstname"
type="text"
length=""
format=""
required="yes" />
<entity name="middlename"
tagid="middlename"
type="text"
length=""
format=""
required="yes" />
<entity name="model"
tagid="model"
type="text"
length=""
format=""
required="yes" />
<entity name="color"
tagid="color"
type="text"
length=""
format=""
required="yes" />
<entity name="fullname"
tagid="fullname"
type="text"
length=""
format=""
required="yes" />
<entity name="address"
tagid="address"
type="text"
length=""
format=""
required="yes" />
<entity name="mobilenumber"
tagid="mobilenumber"
type="text"
length=""
format=""
required="yes" />
<entity name="board"
tagid="board"
type="text"
length=""
format=""
required="yes" />
<entity name="ram"
tagid="ram"
type="text"
length=""
format=""
required="yes" />
<entity name="xray"
tagid="xray"
type="image"
length="2MB"
format=""
required="no" />
</eaventities>
</datamap>








