Tehnici avansate de programare - Profs.info.uaic.ro
Tehnici avansate de programare - Profs.info.uaic.ro
Tehnici avansate de programare - Profs.info.uaic.ro
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Persistenţa relaţiilor<br />
Or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r 1 --- 0..∗ Or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>rItem<br />
Salvarea, citirea, ştergere relaţiilor:<br />
Individual<br />
Or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r = new Or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r();<br />
Or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>rItem item = new Or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>rItem(...);<br />
or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r.addItem(item); ...<br />
mappingLayer.save(or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r);<br />
item.setOr<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>rId(or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r.getId());<br />
mappingLayer.save(item);<br />
Cascadă<br />
mappingLayer.save(or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r);<br />
...<br />
Or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r or<st<strong>ro</strong>ng>de</st<strong>ro</strong>ng>r = mappingLayer.retrieve(id);<br />
Tehnologii <st<strong>ro</strong>ng>avansate</st<strong>ro</strong>ng> <st<strong>ro</strong>ng>de</st<strong>ro</strong>ng> <st<strong>ro</strong>ng>p<strong>ro</strong>gramare</st<strong>ro</strong>ng> – p.34/7