<html> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Cross-Platform Aliasing From .NET To Java</title> <link rel="stylesheet" type="text/css" href="../../../style.css"> </head> <body> <div class="CommonContent"> <div class="CommonContentArea"> <h1>Cross-Platform Aliasing From .NET To Java</h1><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>The following example shows a cross-platform system where classes were saved to the db4o database from a .NET application and read and modified later from a .Java application. A vice versa example is reviewed in <a href="cross-platform_aliasing.html" class="wikiLink">Cross-Platform Aliasing</a>.<br></p> <p>Pilot objects are saved to a database from a .NET application:</p><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InterLanguageExample2.cs: <span class="fscMemberName">SaveObjects</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64"><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;">private</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;"> SaveObjects() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_42_500_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> File.Delete(Db4oFileName); </span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName); </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: #0000FF;">try</span><span style="color: #000000;"> </span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_188_407_Open_Text"><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"/> Pilot pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">"</span><span style="color: #800000;">David Barrichello</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800080;">99</span><span style="color: #000000;">); </span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> container.Set(pilot); </span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">"</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><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"/> container.Set(pilot); </span><span style="color: #008080;">11</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;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> </span><span style="color: #008080;">13</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_SaveObjects_331_64_440_490_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"/> container.Close(); </span><span style="color: #008080;">15</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;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InterLanguageExample2.vb: <span class="fscMemberName">SaveObjects</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub SaveObjects()</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_SaveObjects_395_60_15_462_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> SaveObjects() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> File.Delete(Db4oFileName) </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName) </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;">Try</span><span style="color: #000000;"> </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: #0000FF;">Dim</span><span style="color: #000000;"> pilot </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">"</span><span style="color: #800000;">David Barrichello</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800080;">99</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"/> container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](pilot) </span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">"</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><span style="color: #000000;">) </span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](pilot) </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: #0000FF;">Finally</span><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"/> container.Close() </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;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div> <br></p><p>In order to read the saved objects successfully from a java application we will need to define an alias for persistent classes and an alias for the Db4oDatabase class. We will use a wildcard alias for all the persistent classes:</p><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InterLanguageExample2.java: <span class="fscMemberName">configureAlias</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Open_Text').style.display='inline';"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> Configuration configureAlias() </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_ConfigureAlias_703_71_46_394_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"/> Configuration configuration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4o.newConfiguration(); </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> configuration.addAlias(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> WildcardAlias( </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: #000000;">"</span><span style="color: #000000;">Db4objects.Db4odoc.Aliases.*, Db4objects.Db4odoc</span><span style="color: #000000;">"</span><span style="color: #000000;">, </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: #000000;">"</span><span style="color: #000000;">com.db4odoc.aliases.*</span><span style="color: #000000;">"</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"/> configuration.addAlias(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> TypeAlias( </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: #000000;">"</span><span style="color: #000000;">Db4objects.Db4o.Ext.Db4oDatabase, Db4objects.Db4o</span><span style="color: #000000;">"</span><span style="color: #000000;">, </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: #000000;">"</span><span style="color: #000000;">com.db4o.ext.Db4oDatabase</span><span style="color: #000000;">"</span><span style="color: #000000;">)); </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: #0000FF;">return</span><span style="color: #000000;"> configuration; </span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div>Now the objects are accessible from the Java application:<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InterLanguageExample2.java: <span class="fscMemberName">getObjects</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Open_Text').style.display='inline';"/><span style="color: #0000FF;">private</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;"> getObjects(Configuration configuration) </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_60_478_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 db </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4o.openFile(configuration, DB4O_FILE_NAME); </span><span style="color: #008080;">03</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Open_Text').style.display='inline';"/> </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_137_446_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">04</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Open_Text').style.display='inline';"/> List</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.query(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Predicate</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;">() </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_195_265_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Open_Text').style.display='inline';"/> </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">boolean</span><span style="color: #000000;"> match(Pilot pilot) </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_235_260_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;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">; </span><span style="color: #008080;">07</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;">08</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;">09</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Open_Text').style.display='inline';"/> </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">; i </span><span style="color: #000000;"><</span><span style="color: #000000;"> result.size(); i</span><span style="color: #000000;">++</span><span style="color: #000000;">) </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_311_419_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"/> Pilot pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> result.get(i); </span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> pilot.setName(</span><span style="color: #000000;">"</span><span style="color: #000000;">Modified </span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> pilot.getName()); </span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> db.set(pilot); </span><span style="color: #008080;">13</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;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> listResult(result); </span><span style="color: #008080;">15</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Open_Text').style.display='inline';"/> }</span></span><span style="color: #000000;"> </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesJava.ZipsInterLanguageExample2.Java_InterLanguageExample2.Java_GetObjects_831_67_455_475_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"/> db.close(); </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/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div><p>One thing to remember: field names in class definitions in Java and .NET should be exactly the same.</p><p>We can read the database from the initial .NET application again. Note, that no alias is required as the class definitions were created in this application :</p><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InterLanguageExample2.cs: <span class="fscMemberName">ReadObjects</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64"><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;">private</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;"> ReadObjects() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_42_357_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName); </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;">try</span><span style="color: #000000;"> </span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_149_264_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"/> IList</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></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"/> ListResult(result); </span><span style="color: #008080;">08</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;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> </span><span style="color: #008080;">10</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesCS.ZipsInterLanguageExample2.Cs_InterLanguageExample2.Cs_ReadObjects_1172_64_297_347_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"/> container.Close(); </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/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">InterLanguageExample2.vb: <span class="fscMemberName">ReadObjects</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub ReadObjects()</span><span id="ResourcesReferenceImplementation_StrategiesAliasesAliasesVB.ZipsInterLanguageExample2.Vb_InterLanguageExample2.Vb_ReadObjects_1236_60_15_332_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> ReadObjects() </span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName) </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: #0000FF;">Try</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"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IList(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot) </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot)() </span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> ListResult(result) </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: #0000FF;">Finally</span><span style="color: #000000;"> </span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> container.Close() </span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">9</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div> <br></p></div> </div> <div id="footer"> This revision (1) was last Modified 2007-08-12T19:50:53 by Tetyana. </div> </body> </html>