Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change 
notification.

The following page has been changed by KevinWilliams:
http://wiki.apache.org/ws/Tuscany/TuscanyJava/DAS_Java_Overview/RDBDAS_Java_User_Guide/Convention_over_configuration

------------------------------------------------------------------------------
               ADDRESS    VARCHAR(30)
  }}}
  
+ If an application uses the DAS to query this table with the following SQL 
statement:
+ {{{
+    SELECT * FROM CUSTOMER
+ }}}
  
+ The DAS will return a graph of !DataObjects each of Type CUSTOMER and each 
instance in will have three properties: (ID, LASTNAME, ADDRESS).  Here is the 
example code.  Note that no configuration data is provided at all.
  
- As an example, the RDB DAS must know how a !DataObject's properties map to a 
database table key in order to generate the INSERT/UPDATE and DELETE statements 
necessary to flush a data graph's changes to a database.  In typical 
Object/Relational mappings frameworks, this information is provided in a config 
file with something like this:
+ {{{
+    DAS das = DAS.FACTORY.createDAS(getConnection());
+    Command readCustomers = das.createCommand("select * from CUSTOMER");       
        
+    DataObject root = readCustomers.executeQuery();
+ }}}
+ 
+ Another piece of convention followed by the RDB DAS has to do with database 
table keys.  The RDB DAS scans the SDO !ChangeSummery and generates the set of 
INSERT/UPDATE and DELETE statements needed to flush the graph changes to the 
database.  To generate the correct statements the RDB DAS needs to know how a 
!DataObject's properties map to a database table key.  In typical 
Object/Relational mappings frameworks, this information is provided in a config 
file with something like this:
  
  {{{
     <Table tableName="COMPANY">
@@ -27, +38 @@

     </Table>
  }}}
  
- One convention the RDB DAS understands is that if a !DataObject has a 
property named "ID" then it can assume that the property maps to a key column 
in the database.  So, if a developer follows this convention (naming key 
columns in database tables "ID") then this key-mapping information need not be 
specified in a configuration file.
+ However, the RDB DAS understands is that, in the absence of user provided 
cofiguration data, if a !DataObject has a property named "ID" then it can 
assume that it maps to a key column in the database.  If a developer follows 
this convention (naming key columns in database tables "ID") then this 
key-mapping information need not be specified in a configuration file.
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to