summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/rdb-das-java-faq.html
diff options
context:
space:
mode:
Diffstat (limited to 'site/trunk/site-publish/rdb-das-java-faq.html')
-rw-r--r--site/trunk/site-publish/rdb-das-java-faq.html202
1 files changed, 202 insertions, 0 deletions
diff --git a/site/trunk/site-publish/rdb-das-java-faq.html b/site/trunk/site-publish/rdb-das-java-faq.html
new file mode 100644
index 0000000000..9c8bf1c080
--- /dev/null
+++ b/site/trunk/site-publish/rdb-das-java-faq.html
@@ -0,0 +1,202 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+ <HEAD>
+ <LINK type="text/css" rel="stylesheet" href="http://incubator.apache.org/tuscany/stylesheets/default.css">
+ <LINK rel="SHORTCUT ICON" href="http://cwiki.apache.org/confluence/display/TUSCANY/$images/favicon.ico">
+ <TITLE>RDB DAS Java - FAQ : Apache Tuscany</TITLE>
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
+
+ <BODY onload="init()">
+
+ <TABLE valign="top" border="0" cellspacing="0" cellpadding="0" width="100%" background="http://incubator.apache.org/tuscany/images/TuscanyLogoNEW_Text_120px_bg.jpg">
+ <TR>
+ <TD valing="top" align="left">
+ <A href="http://cwiki.apache.org/confluence/pages/viewpage.action?spaceKey=TUSCANY&title=$siteroot"><IMG src="http://incubator.apache.org/tuscany/images/TuscanyLogoNEW_Text_120px_bg.jpg" height="91" width="25" border="0"></A>
+ </TD>
+ <TD>
+ <A href="http://incubator.apache.org/tuscany/"><IMG src="http://incubator.apache.org/tuscany/images/TuscanyLogo.jpg" border="0"></A>
+ </TD>
+
+ <TD width="100%">
+ &nbsp;
+ </TD>
+ <TD align="right">
+ <IMG src="http://incubator.apache.org/tuscany/images/apache-incubator-logo.png" border="0">
+ </TD>
+
+ <!-- Adds the edit page link to the top banner-->
+ <TD valign="bottom">
+ <DIV style="padding: 2px 10px; margin: 0px;">
+ <A href="http://cwiki.apache.org/confluence/pages/editpage.action?pageId=50994">
+ <IMG src="http://incubator.apache.org/tuscany/images/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
+ </DIV>
+ </TD>
+
+ </TR>
+ </TABLE>
+
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR class="topBar">
+ <TD align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
+ &nbsp;<A href="home.html" title="Apache Tuscany">Apache Tuscany</A>&nbsp;&gt;&nbsp;<A href="home.html" title="Home">Home</A>&nbsp;&gt;&nbsp;<A href="das-overview.html" title="DAS Overview">DAS Overview</A>&nbsp;&gt;&nbsp;<A href="das-java-project.html" title="DAS Java Project">DAS Java Project</A>&nbsp;&gt;&nbsp;<A href="rdb-das.html" title="RDB DAS">RDB DAS</A>&nbsp;&gt;&nbsp;<A href="" title="RDB DAS Java - FAQ">RDB DAS Java - FAQ</A>
+ </TD>
+
+ <TD align="left" valign="middle" class="topBarDiv" nowrap="true">
+ <A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-user">User List</A> | <A href="http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev">Dev List</A> | <A href="http://issues.apache.org/jira/browse/Tuscany">Issue Tracker</A>&nbsp;&nbsp;
+ </TD>
+ </TR>
+ </TABLE>
+
+ <TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
+ <TR>
+ <TD align="left" valign="top">
+ <DIV id="PageContent">
+
+ <DIV class="pagecontent">
+ <DIV class="wiki-content">
+ <TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR><TD class="confluenceTd" valign="top" width="15%">
+<DIV class="panel" style="border-style: solid; border-color: #C3CDA1; "><DIV class="panelHeader" style="border-bottom-style: solid; border-bottom-color: #C3CDA1; background-color: #C3CDA1; "><B>General</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1; ">
+<P><A href="" title="RDB DAS Java - FAQ">FAQ</A><BR>
+<A href="rdb-das-releases.html" title="RDB DAS - Releases">Releases</A><BR>
+<A href="das-downloads.html" title="DAS Downloads">Downloads</A><BR>
+<A href="whats-new-in-das.html" title="What's New in DAS">What's new?</A></P>
+</DIV></DIV>
+
+<DIV class="panel" style="border-style: solid; border-color: #C3CDA1; "><DIV class="panelHeader" style="border-bottom-style: solid; border-bottom-color: #C3CDA1; background-color: #C3CDA1; "><B>Guides</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1; ">
+<P><A href="starting-with-das.html" title="Starting with DAS">Starting with DAS</A><BR>
+<A href="rdb-das-user-guide.html" title="RDB DAS - User Guide">User Guide</A><BR>
+<SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANY&title=RDB%20DAS%20architecture%20guide&linkCreation=true&fromPageId=55092" title="Create Page: RDB DAS architecture guide" class="createlink">Architecture Guide<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN><BR>
+<A href="das-java-project.html" title="DAS Java Project">Developer Guide</A></P>
+</DIV></DIV>
+
+<DIV class="panel" style="border-style: solid; border-color: #C3CDA1; "><DIV class="panelHeader" style="border-bottom-style: solid; border-bottom-color: #C3CDA1; background-color: #C3CDA1; "><B>Development</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1; ">
+<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANY&title=Java%20Doc&linkCreation=true&fromPageId=55092" title="Create Page: Java Doc" class="createlink">Java Doc<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN><BR>
+<SPAN class="nobr"><A href="https://svn.apache.org/repos/asf/incubator/tuscany/java/das/rdb" title="Visit page outside Confluence" rel="nofollow">Source Code<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P>
+</DIV></DIV></TD><TD class="confluenceTd" valign="top" width="85%">
+
+<P>This page will contain frequently asked questions about RDB DAS. Please use the following template to further enhance this page.</P>
+
+<H4><A name="RDBDASJava-FAQ-HowdoesDASimplementinternal%2Fexternaltransactionmanagement%3F"></A>How does DAS implement internal/external transaction management?</H4>
+
+<P>In DAS Config, element ConnectionInfo has a boolean attribute managedtx (default true). <BR>
+If it is true, DAS runtime manages transaction otherwise the caller is supposed to manage<BR>
+transaction.<BR>
+In cases, when the connection is externally passed (config file does not specify ConnectionInfo),<BR>
+the managedtx attribute default value ( true) is assumed.</P>
+
+
+<H4><A name="RDBDASJava-FAQ-Iftwotableshaveaparentchildrelationshipbutthequeryresultsetcontainsonlycolumnsfromonetable%2CdoesRDBDASresultDataGraphcontaindatafrombothparentandchildtable%3F"></A>If two tables have a parent-child relationship but the query result set contains only columns from one table, does RDB DAS result DataGraph contain data from both parent and child table?</H4>
+
+<P>The RDB DAS will only populate a graph with data returned from the used query. If you want a <BR>
+graph that contains data from related tables then the query provided must return that data <BR>
+(typically a join). The relationship tests in the test suite demonstrate this.</P>
+
+<H4><A name="RDBDASJava-FAQ-Iftwotableshaveaparentchildrelationshipandthequeryresultsetcontainscolumnsfrombothtables%2CistherelationshipanalyzedbyDASwhen%2C"></A>If two tables have a parent-child relationship and the query result set contains columns from both tables, is the relationship analyzed by DAS when, </H4>
+<OL>
+ <LI>DAS Config explicitly defines relationship</LI>
+ <LI>DAS Config does not explicitly define relationship?</LI>
+</OL>
+
+
+<P>DAS supports some Convention over Configuration when it comes to supporting implied relationships.<BR>
+<SPAN class="nobr"><A href="conventionoverconfiguration.html" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/ConventionOverConfiguration<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN><BR>
+<SPAN class="nobr"><A href="foreignkeyrepresentationandmanagement.html" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/ForeignKeyRepresentationAndManagement<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN><BR>
+<SPAN class="nobr"><A href="workingwithrelationships.html" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/WorkingWithRelationships<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN><BR>
+Also, see test: ImpliedRelationshipTests.testAddNewOrder() </P>
+
+<P>So, in summary, if the query has a where clause specifying the relationship, there is no need to <BR>
+have any relationship definition in config file as long as the column names (PK, FK) follow the<BR>
+naming conventions. </P>
+
+<P>In the absence of naming conventions, the relationship needs to be explicitly defined in the config,<BR>
+so that the query result is mapped against it and the necessary result DataGraph is represented <BR>
+reflecting the relationship.</P>
+
+<H4><A name="RDBDASJava-FAQ-AsDAS%28andSDO%29supportdisconnectedprocessingofdata%2ChowdoesDASachievemappingbetweenDataGraphpropertiesandDatabaseMetadataliketablename%2Ccolumnnameetc.%3F"></A>As DAS (and SDO) support disconnected processing of data, how does DAS achieve mapping between DataGraph properties and Database Metadata like table name, column name etc.?</H4>
+
+<P>DAS supports this mapping using DAS Config and in the absence of that using Convention over Configuration.<BR>
+<SPAN class="nobr"><A href="conventionoverconfiguration.html" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/ConventionOverConfiguration<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>. DataObject graph<BR>
+change summary contains old as well as modified values. Using this change summary and config/conventions DAS can support the necessary mapping. </P>
+
+<H4><A name="RDBDASJava-FAQ-DoesDASsupportworkingwithtablesthathavenoPKdefined%3F"></A>Does DAS support working with tables that have no PK defined?</H4>
+
+<P>DAS mandates PK for any table, either specified in DAS Config or by following convention. In absence <BR>
+of both of these, DAS throws an error.</P>
+
+<H4><A name="RDBDASJava-FAQ-HowdoesDASsupportdatabasegeneratedkeys%3F"></A>How does DAS support database generated keys?</H4>
+
+<P>This is supported for INSERT operation - either explicit insert (SQL INSERT statement as DAS command) or generated insert. <BR>
+In case of generated insert, the DAS config needs to have Column element having attribute &quot;generated&quot; set to &quot;true&quot;. This attribute is not needed in case of explicit insert.<BR>
+In case of generated insert, &quot;generated&quot; attribute from Column element in Config is checked to form the appropriate insert statement. The jdbc supported PreparedStatement.getGeneratedKeys() is used to fetch the values being generated by the database. In case of generated insert, the value thus returned is set in DataGraph.</P>
+
+<P>This feature is not supported on all versions of Oracle drivers, so DAS does not use this functionality if database is Oracle.</P>
+
+<H4><A name="RDBDASJava-FAQ-WhatmanipulationsdoesDASprovideforDataObjects%3F"></A>What manipulations does DAS provide for DataObjects?</H4>
+
+<P>DAS can get DataObject using Dynamic approach or Static approach. In Dynamic approach the query result set is used to form the DataObject. In static approach, DAS Config's DataObjectModel attribute needs a valid value, using which the DataObjects are created.<BR>
+For more details see <SPAN class="nobr"><A href="graph-merge.html" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/Graph+Merge<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>.</P>
+
+<H4><A name="RDBDASJava-FAQ-Whenthereis1%3Anrelationshipbetween2tables%2CsayDepartment%3AEmployee%2CandthereisaDataGraphwiththisrelationshippresent%2CcanoneEmployeeDataObjectfromthisgraphbeassociatedwith2differentDepartmentDataObjects%2C..."></A>When there is 1:n relationship between 2 tables, say Department:Employee, and there is a DataGraph with this relationship present, can one Employee DataObject from this graph be associated with 2 different Department DataObjects, using DAS Java Client? i.e. can 1:n relationship be changed to n:n using SDO?</H4>
+
+<P>No, when this is attempted, SDO maintains referential integrity. e.g.<BR>
+If you have a dept1 with emp1 and then execute:<BR>
+ dep2.getEmployees.add(emp1)<BR>
+the graph will automatically remove emp1 from dep1's list of employees and<BR>
+you are left with valid 1:m relationship.</P>
+
+<H4><A name="RDBDASJava-FAQ-WhatisOptimisticConcurrencyControl%3F"></A>What is Optimistic Concurrency Control?</H4>
+<P>See details on <SPAN class="nobr"><A href="optimisticconcurrencycontrol.html" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/OptimisticConcurrencyControl<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P>
+
+<P>By default OCC is ON. With this, in generated UPDATE statement, any column undergoing change also gets included in the WHERE clause.</P>
+
+<P>Other than that, in DAS Config, in &lt;Table&gt; element , the &lt;Column&gt; element can have two boolean attributes:- managed(default true), collision</P>
+
+<P>When collision=true for a column, during UPDATE statement generation, that column is included<BR>
+in the WHERE clause.</P>
+
+<P>When managed=true for a column, during UPDATE statement generation, that column (needs to be BigDecimal) value is incremented by 1 and used in the SET clause in UPDATE.</P>
+
+<P>managed=true, is effective only when collision=true, else managed attribute value is ignored.</P>
+
+<H4><A name="RDBDASJava-FAQ-WhatisthepurposeofmanyandkeyRestrictedattributesinRelationship%3F"></A>What is the purpose of many and keyRestricted attributes in Relationship?</H4>
+
+<P>many=true allows for 1:n relationship. If it is false, it's 1:1 relationship. In case of 1:1 relationship, if keyRestricted is not specified, the link (relationship) between the parent and child rows can be broken, by setting the parentKeyTable's row to null/deleting the row. Also, a different parent row can be associated to the child row, which has one pre-existing parent row association. If keyRestricted=true, this kind on change in existing relationship is not allowed, user will get exception 'Can not modify a one to one relationship that is key restricted'.</P>
+
+<H4><A name="RDBDASJava-FAQ-Incaseofparentchildrelationship%2Chowtotraversebackandforth%3F"></A>In case of parent-child relationship, how to traverse back and forth?</H4>
+
+<P>If by Convention over Configuration/from DAS Config there is a name to a relationship, the opposite relationship is named with _opposite appended to it.</P>
+
+<P>e.g. Consider two tables (CUSTOMER, ORDER) each with a PK named &quot;ID&quot;. Also, ORDER has a FK named CUSTOMER_ID. The DAS recognizes this convention and assumes a one:many relationship between CUSTOMER and ORDER. In the fully dynamic case, a read of CUSTOMER and ORDER tables using a join will result in a graph of CUSTOMER DataObjects along with their related ORDERS.(name of relationship is ORDERS now.) </P>
+
+<P>The property for the CUSTOMER Types list of ORDERs is named &quot;ORDER&quot; so:<BR>
+ DataObject order = cust.getDataObject(&quot;ORDER<SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANY&title=1&linkCreation=true&fromPageId=50994" title="Create Page: 1" class="createlink">1<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>&quot;);<BR>
+The name of the property in the ORDER Type that references the parent CUSTOMER, is <BR>
+ DataObject cust = order.getDataObject(&quot;CUSTOMER_opposite&quot;)</P>
+
+<H4><A name="RDBDASJava-FAQ-whatispagingcapability%3F"></A>what is paging capability?</H4>
+
+<P>What is currently available in DAS is detailed on <SPAN class="nobr"><A href="workingwithpaging.html" title="Visit page outside Confluence" rel="nofollow">http://cwiki.apache.org/confluence/display/TUSCANY/WorkingWithPaging<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN><BR>
+Other than sequential page access(pager.next(), pager.previous()), random access is also<BR>
+allowed using pager.getPage(number).</P>
+</TD></TR></TBODY></TABLE>
+ </DIV>
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+
+ <SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </SCRIPT>
+ <SCRIPT type="text/javascript">
+ _uacct = "UA-1174707-5";
+ urchinTracker();
+ </SCRIPT>
+
+ <DIV class="footer">
+ Copyright &copy; 2003-2007, The Apache Software Foundation&nbsp;&nbsp;
+ </DIV>
+
+ </BODY>
+</HTML> \ No newline at end of file