Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 1066

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Schema Evolution</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Schema Evolution</h1><div id="TOC"><div id="TOCinner"><span class="TOCtitle">Contents</span><div class="TOCcontents"><ul><li><a href ="#Schema Evolution in db4o">Schema Evolution in db4o</a></li><li><a href ="#Schema Evolution in SQLite">Schema Evolution in SQLite</a></li><li><a href ="#Conclusion">Conclusion</a></li></ul></li></ul></div></div></div><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script><p>When a new application development is considered it is
important to think about its evolution. What happens if your initial model does
not suffice and you need changes or additions? Let's look how db4o and SQLite
applications can handle it.</p>

<p>To keep the example simple, let's add a registration record
to our car:</p>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">RegistrationRecord.java</span></div><div class="fscCode"><pre ID="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">package</span><span style="color: #000000;"> com.db4odoc.android.compare.refactored;
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">import</span><span style="color: #000000;"> java.util.Date;
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Open_Text').style.display='inline';"/></span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> RegistrationRecord </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_105_480_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>  </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> String number;
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>  </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> Date year;
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> RegistrationRecord(String number, Date year)</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_204_252_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> number;
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.year </span><span style="color: #000000;">=</span><span style="color: #000000;"> year;
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> String getNumber() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_281_302_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> number;
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> setNumber(String number) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_342_370_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> number;
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> Date getYear() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_395_414_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> year;
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> setYear(Date year) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_Srccomdb4odocandroidcomparerefactoredRegistrationRecord.Java_337_104_448_472_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.year </span><span style="color: #000000;">=</span><span style="color: #000000;"> year;
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>  
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>  
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>  
</span><span style="color: #008080;">32</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>}</span></span></div></pre></div></div>

<p>Now we will need to modify Car class to attach the record:</p>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Car.java</span></div><div class="fscCode"><pre ID="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Open_Text').style.display='inline';"/><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_0_67_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;"> Copyright (C) 2004 - 2007 db4objects Inc. </span><span style="color: #008000; text-decoration: underline;">http://www.db4o.com</span><span style="color: #008000;"> </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">package</span><span style="color: #000000;"> com.db4odoc.android.compare.refactored;
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">import</span><span style="color: #000000;"> java.text.DateFormat;
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">import</span><span style="color: #000000;"> java.text.SimpleDateFormat;
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">import</span><span style="color: #000000;"> java.util.Calendar;
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">import</span><span style="color: #000000;"> java.util.GregorianCalendar;
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Open_Text').style.display='inline';"/></span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Car </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_263_1190_Open_Text"><span style="color: #000000;">{   
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> String model;
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> Pilot pilot;
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> RegistrationRecord registration;
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> RegistrationRecord getRegistration() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_410_437_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> registration;
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> setRegistration(RegistrationRecord registration) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_501_541_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.registration </span><span style="color: #000000;">=</span><span style="color: #000000;"> registration;
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> Car()</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_559_572_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> Car(String model) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_607_665_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.model</span><span style="color: #000000;">=</span><span style="color: #000000;">model;
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.pilot</span><span style="color: #000000;">=</span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      
</span><span style="color: #008080;">32</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> Pilot getPilot() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_701_730_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> pilot;
</span><span style="color: #008080;">34</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">35</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    
</span><span style="color: #008080;">36</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> setPilot(Pilot pilot) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_774_809_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">37</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> pilot;
</span><span style="color: #008080;">38</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">39</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    
</span><span style="color: #008080;">40</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> String getModel() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_844_873_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">41</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> model;
</span><span style="color: #008080;">42</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">43</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    
</span><span style="color: #008080;">44</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> String toString() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_908_1123_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">45</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Open_Text').style.display='inline';"/>      </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (registration </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_940_984_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">46</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> model </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">[</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">+</span><span style="color: #000000;">pilot</span><span style="color: #000000;">+</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">]</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">47</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Open_Text').style.display='inline';"/>      }</span></span><span style="color: #000000;"> </span><span style="color: #0000FF;">else</span><span style="color: #000000;"> </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_990_1117_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">48</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        DateFormat df </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> SimpleDateFormat(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">d/M/yyyy</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">49</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> model </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">: </span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> df.format(registration.getYear());
</span><span style="color: #008080;">50</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">51</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">52</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">53</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Open_Text').style.display='inline';"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> setModel(String model) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredCar.Java_Srccomdb4odocandroidcomparerefactoredCar.Java_514_89_1161_1187_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">54</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.model </span><span style="color: #000000;">=</span><span style="color: #000000;"> model;
</span><span style="color: #008080;">55</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">56</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">57</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>}</span></span></div></pre></div></div>

<p>Ok, the application is changed to cater for new class. What
about our databases?</p>

<a name="Schema Evolution in db4o"></a><h3>Schema Evolution in db4o</h3>

<p>db4o supports such schema change on the fly: we can select
values and update the new field too: </p>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Db4oExample.java: <span class="fscMemberName">selectCarAndUpdate</span></span></div><div class="fscCode"><pre ID="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Open_Text').style.display='inline';"/><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> selectCarAndUpdate() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_40_807_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> database();
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Open_Text').style.display='inline';"/>      </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_114_801_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      Query query </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.query();
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.constrain(Car.</span><span style="color: #0000FF;">class</span><span style="color: #000000;">);
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.descend(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">pilot</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">).descend(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">points</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">).constrain(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Integer(</span><span style="color: #000000;">15</span><span style="color: #000000;">));
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">long</span><span style="color: #000000;"> startTime </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.currentTimeMillis();
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ObjectSet  result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.execute();
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      result.reset();
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Open_Text').style.display='inline';"/>      </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">result.hasNext())</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_388_473_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        logToConsole(</span><span style="color: #000000;">0</span><span style="color: #000000;">, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Car not found, refill the database to continue.</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">false</span><span style="color: #000000;">);
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Open_Text').style.display='inline';"/>      }</span></span><span style="color: #000000;"> </span><span style="color: #0000FF;">else</span><span style="color: #000000;"> </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredDb4oExample.Java_Srccomdb4odocandroidcomparerefactoredDb4oExample.Java_SelectCarAndUpdate_844_116_479_790_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        Car car </span><span style="color: #000000;">=</span><span style="color: #000000;"> (Car)result.next();
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        logToConsole(startTime, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Selected Car (</span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> car </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">): </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">false</span><span style="color: #000000;">);
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        startTime </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.currentTimeMillis();
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        car.setRegistration(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> RegistrationRecord(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">A1</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Date(System.currentTimeMillis())));
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        logToConsole(startTime, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Updated Car (</span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> car </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">): </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">true</span><span style="color: #000000;">);
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div><a name="Schema Evolution in SQLite"></a><h3>Schema Evolution in SQLite</h3>

<p>For SQLite database model should be synchronized with the
object model:</p>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SqlExample.java: <span class="fscMemberName">upgradeDatabase</span></span></div><div class="fscCode"><pre ID="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Open_Text').style.display='inline';"/><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> upgradeDatabase(SQLiteDatabase db) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_UpgradeDatabase_1082_112_54_286_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    db.execSQL(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">create table REG_RECORDS (</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">id text primary key,</span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">year date);</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    db.execSQL(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">CREATE INDEX IDX_REG_RECORDS ON REG_RECORDS (id);</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    db.execSQL(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">alter table </span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> DB_TABLE_CAR </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> add reg_record text;</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>  }</span></span></div></pre></div></div>

<p>Now we can try to retrieve and update records:</p>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SqlExample.java: <span class="fscMemberName">selectCarAndUpdate</span></span></div><div class="fscCode"><pre ID="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Open_Text').style.display='inline';"/><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> selectCarAndUpdate() </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_40_1659_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    SQLiteDatabase db </span><span style="color: #000000;">=</span><span style="color: #000000;"> database();
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (db </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_94_1656_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">long</span><span style="color: #000000;"> startTime </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.currentTimeMillis();
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      db.execSQL(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">insert into REG_RECORDS (id,year) values ('A1', DATETIME('NOW'))</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ContentValues updateValues </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ContentValues();
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>          
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #008000;">//</span><span style="color: #008000;"> update car</span><span style="color: #008000;">
</span><span style="color: #008080;">10</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">          updateValues.put(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">reg_record</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">A1</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>          </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> count </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.update(DB_TABLE_CAR, updateValues, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">pilot in (select id from pilot where points = 15)</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">null</span><span style="color: #000000;">);
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Open_Text').style.display='inline';"/>          </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (count </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_504_601_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            logToConsole(</span><span style="color: #000000;">0</span><span style="color: #000000;">, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Car not found, refill the database to continue.</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">false</span><span style="color: #000000;">);
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Open_Text').style.display='inline';"/>          }</span></span><span style="color: #000000;"> </span><span style="color: #0000FF;">else</span><span style="color: #000000;"> </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_607_1652_Open_Text"><span style="color: #000000;">{  
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Cursor c </span><span style="color: #000000;">=</span><span style="color: #000000;">
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                  db.query(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">select c.model, r.id, r.year from car c, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;">
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                      </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">REG_RECORDS r, pilot p where c.reg_record = r.id </span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                      </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">and c.pilot = p.id and p.points = 15;</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">null</span><span style="color: #000000;">);
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Open_Text').style.display='inline';"/>              </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (c.count() </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">) </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_876_1003_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                logToConsole(</span><span style="color: #000000;">0</span><span style="color: #000000;">, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Car not found, refill the database to continue.</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">false</span><span style="color: #000000;">);
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">return</span><span style="color: #000000;">;
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>              }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>              c.first();
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>              String date </span><span style="color: #000000;">=</span><span style="color: #000000;"> c.getString(</span><span style="color: #000000;">2</span><span style="color: #000000;">);
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>              SimpleDateFormat sf </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> SimpleDateFormat(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">yyyy-MM-dd H:mm:ss</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Open_Text').style.display='inline';"/>              </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> </span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1167_1522_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                Date dt </span><span style="color: #000000;">=</span><span style="color: #000000;"> sf.parse(date);
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                RegistrationRecord record </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> RegistrationRecord(c.getString(</span><span style="color: #000000;">1</span><span style="color: #000000;">), dt);
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                Car car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Car();
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                car.setModel(c.getString(</span><span style="color: #000000;">0</span><span style="color: #000000;">));
</span><span style="color: #008080;">32</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                car.setRegistration(record);
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                logToConsole(startTime, </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Updated Car (</span><span style="color: #000000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> car </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">): </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">true</span><span style="color: #000000;">);
</span><span style="color: #008080;">34</span><span style="color: #000000;"><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Open_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Closed_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Closed_Text').style.display='inline';"/><img id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Closed_Text').style.display='none'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Open_Image').style.display='inline'; document.getElementById('..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Open_Text').style.display='inline';"/>              }</span></span><span style="color: #000000;"> </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (ParseException e)</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..DBCompareRefJava.Zipssrccomdb4odocandroidcomparerefactoredSqlExample.Java_Srccomdb4odocandroidcomparerefactoredSqlExample.Java_SelectCarAndUpdate_1255_115_1547_1627_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">35</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                Log.e(Db4oExample.</span><span style="color: #0000FF;">class</span><span style="color: #000000;">.getName(), e.toString());
</span><span style="color: #008080;">36</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>              }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">37</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>              
</span><span style="color: #008080;">38</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>          }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">39</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">40</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>  }</span></span></div></pre></div></div><a name="Conclusion"></a><h3>Conclusion</h3>

<p>You can see that schema evolution is much easier with db4o.
But the main difficulty that is not visible from the example is that schema
evolution with SQLite database can potentially introduce a lot of bugs that
will be difficult to spot. For more information see
<a href="../../implementation_strategies/refactoring_and_schema_evolution.html" class="wikiLink">Refactoring and Schema Evolution</a>.</p>



</div>
    </div>
    <div id="footer">
					This revision (1) was last Modified 2007-12-09T17:12:39 by Tetyana.
				</div>
  </body>
</html>