<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>commits@cayenne.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/"/>
<id>http://mail-archives.apache.org/mod_mbox/cayenne-commits/</id>
<updated>2009-12-09T11:26:02Z</updated>
<entry>
<title>svn commit: r888758 - /cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerProject.java</title>
<author><name>andrey@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091209102049.8462D238899B@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091209102049-8462D238899B@eris-apache-org%3e</id>
<updated>2009-12-09T10:20:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: andrey
Date: Wed Dec  9 10:20:49 2009
New Revision: 888758

URL: http://svn.apache.org/viewvc?rev=888758&amp;view=rev
Log:
should not create empty graph file

Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerProject.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerProject.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerProject.java?rev=888758&amp;r1=888757&amp;r2=888758&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerProject.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerProject.java
Wed Dec  9 10:20:49 2009
@@ -24,6 +24,7 @@
 import org.apache.cayenne.conf.Configuration;
 import org.apache.cayenne.modeler.action.ModelerProjectConfiguration;
 import org.apache.cayenne.modeler.graph.GraphFile;
+import org.apache.cayenne.modeler.graph.GraphMap;
 import org.apache.cayenne.project.ApplicationProject;
 import org.apache.cayenne.project.ProjectFile;
 
@@ -45,9 +46,12 @@
     @Override
     public ProjectFile projectFileForObject(Object obj) {
         if (requiresDomainFile(obj)) {
-            return new GraphFile(this, 
-                ((ModelerProjectConfiguration) getConfiguration()).
-                    getGraphRegistry().getGraphMap((DataDomain) obj));
+            GraphMap map = ((ModelerProjectConfiguration) getConfiguration()).
+                getGraphRegistry().getGraphMap((DataDomain) obj);
+            
+            if (map.size() &gt; 0) {
+                return new GraphFile(this, map);
+            }
         }
         return super.projectFileForObject(obj);
     }




</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (CAY-1331) hessian upgrade stops rop</title>
<author><name>&quot;Marcin Skladaniec (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c268347908.1260331398073.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c268347908-1260331398073-JavaMail-jira@brutus%3e</id>
<updated>2009-12-09T04:03:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/CAY-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12787901#action_12787901
] 

Marcin Skladaniec commented on CAY-1331:
----------------------------------------

forgot to mention, server side there are no exceptions, from server point of view everything
is ok.
this is client side only.

&gt; hessian upgrade stops rop
&gt; -------------------------
&gt;
&gt;                 Key: CAY-1331
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1331
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 3.0 beta 1
&gt;            Reporter: Marcin Skladaniec
&gt;
&gt; I tried to upgrade to most recent hessian library (4.0.2). The Cayenne Hessian transport
stopped working. On client connection is created ok, but once the client-server data channel
is created following exception is thrown:
&gt;      [java] 13:45:27,866 [AWT-EventQueue-0] INFO  org.apache.cayenne.remote.hessian.HessianConnection
:189 - Connecting to [admin:*******@http://delish.ish.com.au:8181/angel-server-cayenne] -
dedicated session.
&gt;      [java] 13:45:28,428 [AWT-EventQueue-0] INFO  org.apache.cayenne.remote.hessian.HessianConnection
:228 - Error establishing remote session. URL - http://delish.ish.com.au:8181/angel-server-cayenne;
CAUSE - expected integer at 0x53 java.lang.String 
&gt;      [java] 13:45:28,430 [AWT-EventQueue-0] INFO  ish.oncourse.controller.LoginController
:429 - Authentication failed.
&gt;      [java] org.apache.cayenne.CayenneRuntimeException: [v.3.0B1 Nov 03 2009 19:16:06]
Error establishing remote session. URL - http://delish.ish.com.au:8181/angel-server-cayenne;
CAUSE - expected integer at 0x53 java.lang.String (org.apache.cayenne.remote.RemoteSession)
&gt;      [java] 	at org.apache.cayenne.remote.hessian.HessianConnection.connect(HessianConnection.java:229)
&gt;      [java] 	at org.apache.cayenne.remote.hessian.HessianConnection.getServerEventBridge(HessianConnection.java:114)
&gt;      [java] 	at org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:256)
&gt;      [java] 	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:94)
&gt;      [java] 	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:76)
&gt;      [java] 	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:71)
&gt;      [java] 	at ish.oncourse.ContextManager.getDataChannel(ContextManager.java:81)
&gt;      [java] 	at ish.oncourse.ContextManager.getChannel(ContextManager.java:70)
&gt;      [java] 	at ish.oncourse.ContextManager.getNewDedicatedContext(ContextManager.java:107)
&gt; ....
&gt;      [java] Caused by: com.caucho.hessian.io.HessianProtocolException: expected integer
at 0x53 java.lang.String (org.apache.cayenne.remote.RemoteSession)
&gt;      [java] 	at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2765)
&gt;      [java] 	at com.caucho.hessian.io.Hessian2Input.expect(Hessian2Input.java:2736)
&gt;      [java] 	at com.caucho.hessian.io.Hessian2Input.readInt(Hessian2Input.java:796)
&gt;      [java] 	at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1621)
&gt;      [java] 	at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:253)
&gt;      [java] 	at $Proxy2.establishSession(Unknown Source)
&gt;      [java] 	at org.apache.cayenne.remote.hessian.HessianConnection.connect(HessianConnection.java:210)
&gt;      [java] 	... 48 more
&gt; as additional info: in our setup we are using basic authentication username and password

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (CAY-1331) hessian upgrade stops rop</title>
<author><name>&quot;Marcin Skladaniec (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1967128699.1260331159411.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1967128699-1260331159411-JavaMail-jira@brutus%3e</id>
<updated>2009-12-09T03:59:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
hessian upgrade stops rop
-------------------------

                 Key: CAY-1331
                 URL: https://issues.apache.org/jira/browse/CAY-1331
             Project: Cayenne
          Issue Type: Bug
          Components: Cayenne Core Library
    Affects Versions: 3.0 beta 1
            Reporter: Marcin Skladaniec


I tried to upgrade to most recent hessian library (4.0.2). The Cayenne Hessian transport stopped
working. On client connection is created ok, but once the client-server data channel is created
following exception is thrown:

     [java] 13:45:27,866 [AWT-EventQueue-0] INFO  org.apache.cayenne.remote.hessian.HessianConnection
:189 - Connecting to [admin:*******@http://delish.ish.com.au:8181/angel-server-cayenne] -
dedicated session.
     [java] 13:45:28,428 [AWT-EventQueue-0] INFO  org.apache.cayenne.remote.hessian.HessianConnection
:228 - Error establishing remote session. URL - http://delish.ish.com.au:8181/angel-server-cayenne;
CAUSE - expected integer at 0x53 java.lang.String 
     [java] 13:45:28,430 [AWT-EventQueue-0] INFO  ish.oncourse.controller.LoginController
:429 - Authentication failed.
     [java] org.apache.cayenne.CayenneRuntimeException: [v.3.0B1 Nov 03 2009 19:16:06] Error
establishing remote session. URL - http://delish.ish.com.au:8181/angel-server-cayenne; CAUSE
- expected integer at 0x53 java.lang.String (org.apache.cayenne.remote.RemoteSession)
     [java] 	at org.apache.cayenne.remote.hessian.HessianConnection.connect(HessianConnection.java:229)
     [java] 	at org.apache.cayenne.remote.hessian.HessianConnection.getServerEventBridge(HessianConnection.java:114)
     [java] 	at org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:256)
     [java] 	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:94)
     [java] 	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:76)
     [java] 	at org.apache.cayenne.remote.ClientChannel.&lt;init&gt;(ClientChannel.java:71)
     [java] 	at ish.oncourse.ContextManager.getDataChannel(ContextManager.java:81)
     [java] 	at ish.oncourse.ContextManager.getChannel(ContextManager.java:70)
     [java] 	at ish.oncourse.ContextManager.getNewDedicatedContext(ContextManager.java:107)
....
     [java] Caused by: com.caucho.hessian.io.HessianProtocolException: expected integer at
0x53 java.lang.String (org.apache.cayenne.remote.RemoteSession)
     [java] 	at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2765)
     [java] 	at com.caucho.hessian.io.Hessian2Input.expect(Hessian2Input.java:2736)
     [java] 	at com.caucho.hessian.io.Hessian2Input.readInt(Hessian2Input.java:796)
     [java] 	at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1621)
     [java] 	at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:253)
     [java] 	at $Proxy2.establishSession(Unknown Source)
     [java] 	at org.apache.cayenne.remote.hessian.HessianConnection.connect(HessianConnection.java:210)
     [java] 	... 48 more

as additional info: in our setup we are using basic authentication username and password


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Closed: (CAY-1330) Download page does not have link to KEYS file</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1141366073.1260305118185.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1141366073-1260305118185-JavaMail-jira@brutus%3e</id>
<updated>2009-12-08T20:45:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1330.
--------------------------------

    Resolution: Fixed

Ah good point. I just added a note about KEYS file:

http://cwiki.apache.org/confluence/display/CAYSITE/Download

(it will be automatically synced to the site in a due time)

&gt; Download page does not have link to KEYS file
&gt; ---------------------------------------------
&gt;
&gt;                 Key: CAY-1330
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1330
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;         Environment: http://cayenne.apache.org/download.html
&gt;            Reporter: Sebb
&gt;            Priority: Critical
&gt;
&gt; http://cayenne.apache.org/download.html needs a link to the KEYS file, i.e. http://www.apache.org/dist/cayenne/KEYS.
&gt; This is essential to allow users to check the signature (.asc) files.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[CONF] Apache Cayenne Website &gt; Download</title>
<author><name>confluence@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c499902946.46.1260305100034.JavaMail.www-data@brutus%3e"/>
<id>urn:uuid:%3c499902946-46-1260305100034-JavaMail-www-data@brutus%3e</id>
<updated>2009-12-08T20:45:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://cwiki.apache.org/confluence"&gt;
            &lt;link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAYSITE&amp;amp;forWysiwyg=true"
type="text/css"&gt;
    &lt;/head&gt;
&lt;body style="background-color: white" bgcolor="white"&gt;
&lt;div id="pageContent"&gt;
&lt;div id="notificationFormat"&gt;
&lt;div class="wiki-content"&gt;
&lt;div class="email"&gt;
     &lt;h2&gt;&lt;a href="http://cwiki.apache.org/confluence/display/CAYSITE/Download"&gt;Download&lt;/a&gt;&lt;/h2&gt;
     &lt;h4&gt;Page &lt;b&gt;edited&lt;/b&gt; by             &lt;a href="http://cwiki.apache.org/confluence/display/~andrus"&gt;Andrus
Adamchik&lt;/a&gt;
    &lt;/h4&gt;
     
          &lt;br/&gt;
     &lt;div class="notificationGreySide"&gt;
         &lt;h2&gt;&lt;a name="Download-Download"&gt;&lt;/a&gt;Download&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;KEYS file to verify the file signatures can be &lt;a href="http://www.apache.org/dist/cayenne/KEYS"
rel="nofollow"&gt;found here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;&lt;a name="Download-3.0BetaRelease"&gt;&lt;/a&gt;3.0 Beta Release&lt;/h3&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.apache.org/dyn/closer.cgi/cayenne/cayenne-3.0B1.tar.gz"
rel="nofollow"&gt;Cayenne 3.0B1&lt;/a&gt; with cross-platform Java CayenneModeler.  (&lt;a
href="http://www.apache.org/dist/cayenne/cayenne-3.0B1.tar.gz.asc" rel="nofollow"&gt;pgp&lt;/a&gt;,
&lt;a href="http://www.apache.org/dist/cayenne/cayenne-3.0B1.tar.gz.md5" rel="nofollow"&gt;md5&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.apache.org/dyn/closer.cgi/cayenne/cayenne-3.0B1-macosx.dmg"
rel="nofollow"&gt;Cayenne 3.0B1&lt;/a&gt; with Mac OS X CayenneModeler.  (&lt;a href="http://www.apache.org/dist/cayenne/cayenne-3.0B1-macosx.dmg.asc"
rel="nofollow"&gt;pgp&lt;/a&gt;, &lt;a href="http://www.apache.org/dist/cayenne/cayenne-3.0B1-macosx.dmg.md5"
rel="nofollow"&gt;md5&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.apache.org/dyn/closer.cgi/cayenne/cayenne-3.0B1-win.zip"
rel="nofollow"&gt;Cayenne 3.0B1&lt;/a&gt; with Windows CayenneModeler.  (&lt;a href="http://www.apache.org/dist/cayenne/cayenne-3.0B1-win.zip.asc"
rel="nofollow"&gt;pgp&lt;/a&gt;, &lt;a href="http://www.apache.org/dist/cayenne/cayenne-3.0B1-win.zip.md5"
rel="nofollow"&gt;md5&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://svn.apache.org/repos/asf/cayenne/main/tags/3.0B1/docs/doc/src/main/resources/RELEASE-NOTES.txt"
rel="nofollow"&gt;Release Notes&lt;/a&gt; for Cayenne 3.0B1.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;&lt;a name="Download-LatestStableReleases"&gt;&lt;/a&gt;Latest Stable Releases&lt;/h3&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.apache.org/dyn/closer.cgi/cayenne/cayenne-2.0.4.tar.gz"
rel="nofollow"&gt;Cayenne 2.0.4&lt;/a&gt; with cross-platform Java CayenneModeler.  (&lt;a
href="http://www.apache.org/dist/cayenne/cayenne-2.0.4.tar.gz.asc" rel="nofollow"&gt;pgp&lt;/a&gt;,
&lt;a href="http://www.apache.org/dist/cayenne/cayenne-2.0.4.tar.gz.md5" rel="nofollow"&gt;md5&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.apache.org/dyn/closer.cgi/cayenne/cayenne-2.0.4-macosx.dmg"
rel="nofollow"&gt;Cayenne 2.0.4&lt;/a&gt; with Mac OS X CayenneModeler.  (&lt;a href="http://www.apache.org/dist/cayenne/cayenne-2.0.4-macosx.dmg.asc"
rel="nofollow"&gt;pgp&lt;/a&gt;, &lt;a href="http://www.apache.org/dist/cayenne/cayenne-2.0.4-macosx.dmg.md5"
rel="nofollow"&gt;md5&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.apache.org/dyn/closer.cgi/cayenne/cayenne-2.0.4-win.zip"
rel="nofollow"&gt;Cayenne 2.0.4&lt;/a&gt; with Windows CayenneModeler.  (&lt;a href="http://www.apache.org/dist/cayenne/cayenne-2.0.4-win.zip.asc"
rel="nofollow"&gt;pgp&lt;/a&gt;, &lt;a href="http://www.apache.org/dist/cayenne/cayenne-2.0.4-win.zip.md5"
rel="nofollow"&gt;md5&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://prdownloads.sourceforge.net/cayenne/cayenne-1.2.4.tar.gz" rel="nofollow"&gt;Cayenne
1.2.4&lt;/a&gt; with cross-platform Java CayenneModeler.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://prdownloads.sourceforge.net/cayenne/cayenne-1.2.4-macosx.dmg"
rel="nofollow"&gt;Cayenne 1.2.4&lt;/a&gt; with Mac OS X CayenneModeler.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://prdownloads.sourceforge.net/cayenne/cayenne-1.2.4-win.zip" rel="nofollow"&gt;Cayenne
1.2.4&lt;/a&gt; with Windows CayenneModeler.&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;&lt;a name="Download-Nightlybuilds"&gt;&lt;/a&gt;Nightly builds&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://hudson.zones.apache.org/hudson/job/Cayenne-trunk/lastBuild/"
rel="nofollow"&gt;Individual Cayenne modules&lt;/a&gt; are built from the SVN trunk by our
continuous integration server.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://svn.apache.org/repos/asf/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt"
rel="nofollow"&gt;Release Notes&lt;/a&gt; for the development trunk.&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;&lt;a name="Download-Legacy"&gt;&lt;/a&gt;Legacy&lt;/h3&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://archive.apache.org/dist/cayenne/" rel="nofollow"&gt;All previous
Apache Cayenne releases&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://prdownloads.sourceforge.net/cayenne/cayenne-1.1.4.tar.gz" rel="nofollow"&gt;Cayenne
1.1.4&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=48132" rel="nofollow"&gt;Other
pre-Apache Legacy Releases&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;&lt;a name="Download-Maven2"&gt;&lt;/a&gt;Maven 2&lt;/h3&gt;

&lt;p&gt;Maven2 bundles for Cayenne are available from the default repository at &lt;a href="http://repo1.maven.org/maven2/"
rel="nofollow"&gt;http://repo1.maven.org/maven2/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cayenne 3.0:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;groupId: org.apache.cayenne&lt;/li&gt;
	&lt;li&gt;artifactId: cayenne-server, cayenne-client, cayenne-agent, cayenne-modeler&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;groupId: org.apache.cayenne.plugins&lt;/li&gt;
	&lt;li&gt;artifactId: maven-cayenne-plugin&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;em&gt;Cayenne 2.0:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;groupId: org.apache.cayenne&lt;/li&gt;
	&lt;li&gt;artifactId: cayenne-nodeps, cayenne-client-nodeps, cayenne-modeler&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;em&gt;Cayenne 1.2:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;groupId: org.objectstyle.cayenne&lt;/li&gt;
	&lt;li&gt;artifactId: cayenne, cayenne-nodeps and cayenne-client-nodeps&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;em&gt;Cayenne 3.0 Snapshots:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;3.0 trunk snapshots are &lt;b&gt;occasionally&lt;/b&gt; posted to the Apache snapshot
repository at &lt;a href="http://people.apache.org/repo/m2-snapshot-repository/" rel="nofollow"&gt;http://people.apache.org/repo/m2-snapshot-repository/&lt;/a&gt;.
Browse the list of available snapshot modules &lt;a href="http://people.apache.org/repo/m2-snapshot-repository/org/apache/cayenne/"
rel="nofollow"&gt;here&lt;/a&gt;. Please check the dates on the snapshots - they may turn
out to be pretty old. Also, please be aware that these snapshots may be purged at any time,
so keep local copies of anything you need to refer to in the future.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Continuous testing snaphots&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://hudson.zones.apache.org/hudson/view/Cayenne/" rel="nofollow"&gt;Our
continuous testing server&lt;/a&gt; builds Cayenne and runs a suite of tests after every change
to the source. You can access the latest copies of built artifact from that server and see
the results of the test suite at any time. For example, the latest client jar can be found
&lt;a href="http://hudson.zones.apache.org/hudson/view/Cayenne/job/Cayenne-trunk/lastBuild/org.apache.cayenne$cayenne-client/artifact/org.apache.cayenne/cayenne-client/3.0-SNAPSHOT/cayenne-client-3.0-SNAPSHOT.jar/*fingerprint*/"
rel="nofollow"&gt;here&lt;/a&gt;&lt;/p&gt;

     &lt;/div&gt;
     &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
       &lt;div style="float: right;"&gt;
            &lt;a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey"&gt;Change Notification Preferences&lt;/a&gt;
       &lt;/div&gt;

       &lt;a href="http://cwiki.apache.org/confluence/display/CAYSITE/Download"&gt;View Online&lt;/a&gt;
       |
       &lt;a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=34976&amp;revisedVersion=28&amp;originalVersion=27"&gt;View
Change&lt;/a&gt;
            &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (CAY-1330) Download page does not have link to KEYS file</title>
<author><name>&quot;Sebb (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1927512129.1260303438988.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1927512129-1260303438988-JavaMail-jira@brutus%3e</id>
<updated>2009-12-08T20:17:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Download page does not have link to KEYS file
---------------------------------------------

                 Key: CAY-1330
                 URL: https://issues.apache.org/jira/browse/CAY-1330
             Project: Cayenne
          Issue Type: Bug
         Environment: http://cayenne.apache.org/download.html
            Reporter: Sebb
            Priority: Critical


http://cayenne.apache.org/download.html needs a link to the KEYS file, i.e. http://www.apache.org/dist/cayenne/KEYS.

This is essential to allow users to check the signature (.asc) files.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1329) DI-based cayenne-project module</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1571343271.1260281238068.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1571343271-1260281238068-JavaMail-jira@brutus%3e</id>
<updated>2009-12-08T14:07:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik updated CAY-1329:
---------------------------------

    Description: Create a new module (cayenne-project-unpublished) for managing filesystem-based
Cayenne projects. I.e. this will mirror o.a.c.project and o.a.c.configuration (project saving
parts) , only will be based on the new DI stack. The module will have an attached DI configuration
that can be used in the Modeler.  (was: Create a new module (cayenne-project-unpublished)
for managing filesystem-based Cayenne projects. I.e. this will mirror o.a.c.project and o.a.c.configuration
(porject saving parts) , only will be based on the new DI stack. The module will have an attached
DI configuration that can be used in the Modeler.)

&gt; DI-based cayenne-project module
&gt; -------------------------------
&gt;
&gt;                 Key: CAY-1329
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1329
&gt;             Project: Cayenne
&gt;          Issue Type: Task
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 3.0M1
&gt;            Reporter: Andrus Adamchik
&gt;            Assignee: Andrus Adamchik
&gt;
&gt; Create a new module (cayenne-project-unpublished) for managing filesystem-based Cayenne
projects. I.e. this will mirror o.a.c.project and o.a.c.configuration (project saving parts)
, only will be based on the new DI stack. The module will have an attached DI configuration
that can be used in the Modeler.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (CAY-1329) DI-based cayenne-project module</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c177675299.1260281118078.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c177675299-1260281118078-JavaMail-jira@brutus%3e</id>
<updated>2009-12-08T14:05:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
DI-based cayenne-project module
-------------------------------

                 Key: CAY-1329
                 URL: https://issues.apache.org/jira/browse/CAY-1329
             Project: Cayenne
          Issue Type: Task
          Components: Cayenne Core Library
    Affects Versions: 3.0M1
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik


Create a new module (cayenne-project-unpublished) for managing filesystem-based Cayenne projects.
I.e. this will mirror o.a.c.project and o.a.c.configuration (porject saving parts) , only
will be based on the new DI stack. The module will have an attached DI configuration that
can be used in the Modeler.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Closed: (CAY-1231) Problem with CLOB field under Oracle</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c608433254.1260275778313.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c608433254-1260275778313-JavaMail-jira@brutus%3e</id>
<updated>2009-12-08T12:36:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1231.
--------------------------------

    Resolution: Not A Problem

&gt; Problem with CLOB field under Oracle
&gt; ------------------------------------
&gt;
&gt;                 Key: CAY-1231
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1231
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0 branch
&gt;         Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5 
&gt;            Reporter: Eugene Matyushkin
&gt;            Assignee: Andrus Adamchik
&gt;            Priority: Critical
&gt;         Attachments: CAY-1231_check.patch
&gt;
&gt;
&gt; 1. Creating table:
&gt; CREATE TABLE CRM_PDOCTYPECAT (
&gt;       PDOCTYPECATID     NUMERIC(19,0) NOT NULL,
&gt;       CATNAME           VARCHAR(255) NOT NULL,       
&gt;       CATDESCRIPTION    CLOB NULL                    	
&gt; );
&gt; 2. Creating named query
&gt; INSERT INTO CRM_PDOCTYPECAT(
&gt; 	PDOCTYPECATID,
&gt; 	CATNAME,
&gt; 	CATDESCRIPTION
&gt; ) VALUES (
&gt; 	#bind($PDOCTYPECATID 'NUMERIC'),
&gt; 	#bind($CATNAME 'VARCHAR'),
&gt;    	#bind($CATDESCRIPTION 'CLOB')
&gt; )
&gt; 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
&gt; 4. Executing query 
&gt; Result: 
&gt; 2009-05-28 13:32:03,053 [main] INFO  org.apache.cayenne.access.QueryLogger - *** error.
&gt; java.sql.SQLException: setString can process only strings less then 32766 symbols in
length
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
&gt; I guess, setClob should be used instead of setString when working with CLOBs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1231) Problem with CLOB field under Oracle</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1831798826.1260275778205.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1831798826-1260275778205-JavaMail-jira@brutus%3e</id>
<updated>2009-12-08T12:36:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik updated CAY-1231:
---------------------------------

    Fix Version/s:     (was: 2.0.5)

so changing some jira fields here... I understand that nothing has to be changed in Cayenne,
and the fix is to upgrade Oracle driver.

&gt; Problem with CLOB field under Oracle
&gt; ------------------------------------
&gt;
&gt;                 Key: CAY-1231
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1231
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0 branch
&gt;         Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5 
&gt;            Reporter: Eugene Matyushkin
&gt;            Assignee: Andrus Adamchik
&gt;            Priority: Critical
&gt;         Attachments: CAY-1231_check.patch
&gt;
&gt;
&gt; 1. Creating table:
&gt; CREATE TABLE CRM_PDOCTYPECAT (
&gt;       PDOCTYPECATID     NUMERIC(19,0) NOT NULL,
&gt;       CATNAME           VARCHAR(255) NOT NULL,       
&gt;       CATDESCRIPTION    CLOB NULL                    	
&gt; );
&gt; 2. Creating named query
&gt; INSERT INTO CRM_PDOCTYPECAT(
&gt; 	PDOCTYPECATID,
&gt; 	CATNAME,
&gt; 	CATDESCRIPTION
&gt; ) VALUES (
&gt; 	#bind($PDOCTYPECATID 'NUMERIC'),
&gt; 	#bind($CATNAME 'VARCHAR'),
&gt;    	#bind($CATDESCRIPTION 'CLOB')
&gt; )
&gt; 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
&gt; 4. Executing query 
&gt; Result: 
&gt; 2009-05-28 13:32:03,053 [main] INFO  org.apache.cayenne.access.QueryLogger - *** error.
&gt; java.sql.SQLException: setString can process only strings less then 32766 symbols in
length
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
&gt; I guess, setClob should be used instead of setString when working with CLOBs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Reopened: (CAY-1231) Problem with CLOB field under Oracle</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c982927212.1260275778256.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c982927212-1260275778256-JavaMail-jira@brutus%3e</id>
<updated>2009-12-08T12:36:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik reopened CAY-1231:
----------------------------------


&gt; Problem with CLOB field under Oracle
&gt; ------------------------------------
&gt;
&gt;                 Key: CAY-1231
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1231
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0 branch
&gt;         Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5 
&gt;            Reporter: Eugene Matyushkin
&gt;            Assignee: Andrus Adamchik
&gt;            Priority: Critical
&gt;         Attachments: CAY-1231_check.patch
&gt;
&gt;
&gt; 1. Creating table:
&gt; CREATE TABLE CRM_PDOCTYPECAT (
&gt;       PDOCTYPECATID     NUMERIC(19,0) NOT NULL,
&gt;       CATNAME           VARCHAR(255) NOT NULL,       
&gt;       CATDESCRIPTION    CLOB NULL                    	
&gt; );
&gt; 2. Creating named query
&gt; INSERT INTO CRM_PDOCTYPECAT(
&gt; 	PDOCTYPECATID,
&gt; 	CATNAME,
&gt; 	CATDESCRIPTION
&gt; ) VALUES (
&gt; 	#bind($PDOCTYPECATID 'NUMERIC'),
&gt; 	#bind($CATNAME 'VARCHAR'),
&gt;    	#bind($CATDESCRIPTION 'CLOB')
&gt; )
&gt; 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
&gt; 4. Executing query 
&gt; Result: 
&gt; 2009-05-28 13:32:03,053 [main] INFO  org.apache.cayenne.access.QueryLogger - *** error.
&gt; java.sql.SQLException: setString can process only strings less then 32766 symbols in
length
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
&gt; I guess, setClob should be used instead of setString when working with CLOBs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[CONF] Apache Cayenne &gt; Board Report December 2009</title>
<author><name>confluence@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1052775454.1391.1260245460113.JavaMail.www-data@brutus%3e"/>
<id>urn:uuid:%3c1052775454-1391-1260245460113-JavaMail-www-data@brutus%3e</id>
<updated>2009-12-08T04:11:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://cwiki.apache.org/confluence"&gt;
            &lt;link rel="stylesheet" href="/confluence/s/1519/1/25/_/styles/combined.css?spaceKey=CAY&amp;amp;forWysiwyg=true"
type="text/css"&gt;
    &lt;/head&gt;
&lt;body style="background-color: white" bgcolor="white"&gt;
&lt;div id="pageContent"&gt;
&lt;div id="notificationFormat"&gt;
&lt;div class="wiki-content"&gt;
&lt;div class="email"&gt;
    &lt;h2&gt;&lt;a href="http://cwiki.apache.org/confluence/display/CAY/Board+Report+December+2009"&gt;Board
Report December 2009&lt;/a&gt;&lt;/h2&gt;
    &lt;h4&gt;Page  &lt;b&gt;added&lt;/b&gt; by             &lt;a href="http://cwiki.apache.org/confluence/display/~blacknext"&gt;Michael
Gentry&lt;/a&gt;
    &lt;/h4&gt;
         &lt;br/&gt;
    &lt;div class="notificationGreySide"&gt;
         &lt;div class='panelMacro'&gt;&lt;table class='warningMacro'&gt;&lt;colgroup&gt;&lt;col
width='24'&gt;&lt;col&gt;&lt;/colgroup&gt;&lt;tr&gt;&lt;td valign='top'&gt;&lt;img src="/confluence/images/icons/emoticons/forbidden.gif"
width="16" height="16" align="absmiddle" alt="" border="0"&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Warning&lt;/b&gt;&lt;br
/&gt;&lt;p&gt;This board report has not yet been finalized.  This message will be removed
once finished.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Development&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Released Cayenne 3.0 Beta 1.  Barring errors discovered during the beta phase,
the 3.0 API is frozen.  A few more features in Cayenne Modeler are still planned which are
external to the API.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Community&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Added Olga Tkachova as a committer.&lt;/li&gt;
	&lt;li&gt;Added Evgeny Ryabitskiy as a committer.&lt;/li&gt;
	&lt;li&gt;Activity on the user and development lists has been normal.&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
       &lt;div style="float: right;"&gt;
            &lt;a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey"&gt;Change Notification Preferences&lt;/a&gt;
       &lt;/div&gt;
       &lt;a href="http://cwiki.apache.org/confluence/display/CAY/Board+Report+December+2009"&gt;View
Online&lt;/a&gt;
              |
       &lt;a href="http://cwiki.apache.org/confluence/display/CAY/Board+Report+December+2009?showComments=true&amp;amp;showCommentArea=true#addcomment"&gt;Add
Comment&lt;/a&gt;
           &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>[CONF] Apache Cayenne &gt; Board Reports</title>
<author><name>confluence@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1096573793.1389.1260245160059.JavaMail.www-data@brutus%3e"/>
<id>urn:uuid:%3c1096573793-1389-1260245160059-JavaMail-www-data@brutus%3e</id>
<updated>2009-12-08T04:06:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://cwiki.apache.org/confluence"&gt;
            &lt;link rel="stylesheet" href="/confluence/s/1519/1/25/_/styles/combined.css?spaceKey=CAY&amp;amp;forWysiwyg=true"
type="text/css"&gt;
    &lt;/head&gt;
&lt;body style="background-color: white" bgcolor="white"&gt;
&lt;div id="pageContent"&gt;
&lt;div id="notificationFormat"&gt;
&lt;div class="wiki-content"&gt;
&lt;div class="email"&gt;
     &lt;h2&gt;&lt;a href="http://cwiki.apache.org/confluence/display/CAY/Board+Reports"&gt;Board
Reports&lt;/a&gt;&lt;/h2&gt;
     &lt;h4&gt;Page &lt;b&gt;edited&lt;/b&gt; by             &lt;a href="http://cwiki.apache.org/confluence/display/~blacknext"&gt;Michael
Gentry&lt;/a&gt;
    &lt;/h4&gt;
     Added December.
          &lt;div id="versionComment" class="noteMacro" style="display:none; padding: 5px;"&gt;
     Added December.&lt;br /&gt;
     &lt;/div&gt;
          &lt;br/&gt;
     &lt;div class="notificationGreySide"&gt;
         &lt;h2&gt;&lt;a name="BoardReports-CayenneASFboardreports"&gt;&lt;/a&gt;Cayenne ASF
board reports&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;note that the board reports text is intentionally kept formatting-free
so that it can be pasted into a text email&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="/confluence/display/CAY/Board+Report+January+2007" title="Board Report
January 2007"&gt;January 2007&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+February+2007" title="Board Report February
2007"&gt;February 2007&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+March+2007" title="Board Report March 2007"&gt;March
2007&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+June+2007" title="Board Report June 2007"&gt;June
2007&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+September+2007" title="Board Report September
2007"&gt;September 2007&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+December+2007" title="Board Report December
2007"&gt;December 2007&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+March+2008" title="Board Report March 2008"&gt;March
2008&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+June+2008" title="Board Report June 2008"&gt;June
2008&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+September+2008" title="Board Report September
2008"&gt;September 2008&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+December+2008" title="Board Report December
2008"&gt;December 2008&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+March+2009" title="Board Report March 2009"&gt;March
2009&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+June+2009" title="Board Report June 2009"&gt;June
2009&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/display/CAY/Board+Report+September+2009" title="Board Report September
2009"&gt;September 2009&lt;/a&gt;&lt;br/&gt;
&lt;a href="/confluence/pages/createpage.action?spaceKey=CAY&amp;amp;title=Board+Report+December+2009&amp;amp;linkCreation=true&amp;amp;fromPageId=46140"
class="createlink"&gt;December 2009&lt;/a&gt;&lt;/p&gt;
     &lt;/div&gt;
     &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
       &lt;div style="float: right;"&gt;
            &lt;a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey"&gt;Change Notification Preferences&lt;/a&gt;
       &lt;/div&gt;

       &lt;a href="http://cwiki.apache.org/confluence/display/CAY/Board+Reports"&gt;View Online&lt;/a&gt;
       |
       &lt;a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=46140&amp;revisedVersion=16&amp;originalVersion=15"&gt;View
Change&lt;/a&gt;
              |
       &lt;a href="http://cwiki.apache.org/confluence/display/CAY/Board+Reports?showComments=true&amp;amp;showCommentArea=true#addcomment"&gt;Add
Comment&lt;/a&gt;
            &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887949 - in /cayenne/main/trunk: docs/doc/src/main/resources/UPGRADE.txt framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091207151901.D265D23889BB@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091207151901-D265D23889BB@eris-apache-org%3e</id>
<updated>2009-12-07T15:19:01Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: aadamchik
Date: Mon Dec  7 15:19:01 2009
New Revision: 887949

URL: http://svn.apache.org/viewvc?rev=887949&amp;view=rev
Log:
CAY-1319 Switch Cayenne configuration loading to cayenne-di container

* Adding a converter of the legacy DataSourceFactory names
* Upgrade instrcutions for custom factories

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/UPGRADE.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/UPGRADE.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/UPGRADE.txt?rev=887949&amp;r1=887948&amp;r2=887949&amp;view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/UPGRADE.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/UPGRADE.txt Mon Dec  7 15:19:01 2009
@@ -8,6 +8,23 @@
   using removed EntityUtil methods (those were replaced by variables placed directly into
   Velocity context)
 
+* Custom DataSourceFactory: The interface used by Cayenne to load custom DataSource factories
has changed
+  from org.apache.cayenne.conf.DataSourceFactory to org.apache.cayenne.configuration.DataSourceFactory.

+  This new interface must be implemented by the custom factories. Note that now custom
+  implementations can rely on Cayenne to inject dependencies into them using @Inject annotation.
+
+* Custom DbAdapter / DbAdapterFactory: The interface used by Cayenne to allow custom DbAdapters
to be auto-detected 
+  with AutoAdapter has changed from org.apache.cayenne.dba.DbAdapterFactory to org.apache.cayenne.configuration.DbAdapterDetector.

+  Note that now custom implementations can rely on Cayenne to inject dependencies into them
using @Inject annotation.
+  To register a custom implementation with Cayenne DI container, one might do this in the
custom DI module:
+
+  ... 
+  public void configure(Binder binder) {
+  ...
+     binder.bindList(DbAdapterFactory.class).add(new MyDbAdapterDetector());
+  }
+
+
 UPGRADING FROM 3.0M6
 
 * Per CAY-1281 pre-persist callback was renamed to post-add (while pre-persist now has a
different meaning).

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java?rev=887949&amp;r1=887948&amp;r2=887949&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
Mon Dec  7 15:19:01 2009
@@ -21,6 +21,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.map.DataMap;
@@ -46,6 +48,21 @@
     static final String PROPERTY_TAG = "property";
     static final String MAP_REF_TAG = "map-ref";
 
+    private static final Map&lt;String, String&gt; dataSourceFactoryNameMapping;
+
+    static {
+        dataSourceFactoryNameMapping = new HashMap&lt;String, String&gt;();
+        dataSourceFactoryNameMapping.put(
+                "org.apache.cayenne.conf.DriverDataSourceFactory",
+                XMLPoolingDataSourceFactory.class.getName());
+        dataSourceFactoryNameMapping.put(
+                "org.apache.cayenne.conf.JNDIDataSourceFactory",
+                JNDIDataSourceFactory.class.getName());
+        dataSourceFactoryNameMapping.put(
+                "org.apache.cayenne.conf.DBCPDataSourceFactory",
+                DBCPDataSourceFactory.class.getName());
+    }
+
     private DataMapLoader mapLoader;
     private Log logger;
 
@@ -96,6 +113,20 @@
         return descriptor;
     }
 
+    /**
+     * Converts the names of standard Cayenne-supplied DataSourceFactories from the legacy
+     * names to the current names.
+     */
+    private String convertDataSourceFactory(String dataSourceFactory) {
+
+        if (dataSourceFactory == null) {
+            return null;
+        }
+
+        String converted = dataSourceFactoryNameMapping.get(dataSourceFactory);
+        return converted != null ? converted : dataSourceFactory;
+    }
+
     final class DataChannelHandler extends SAXNestedTagHandler {
 
         private DataChannelDescriptor descriptor;
@@ -167,12 +198,12 @@
                 nodeDescriptor.setName(nodeName);
                 nodeDescriptor.setAdapterType(attributes.getValue("", "adapter"));
 
-                // TODO: andrus, 11.29.2009 : should we rename that to "location"??
                 String location = attributes.getValue("", "datasource");
                 nodeDescriptor.setLocation(location);
 
-                nodeDescriptor.setDataSourceFactoryType(attributes
-                        .getValue("", "factory"));
+                String dataSourceFactory = attributes.getValue("", "factory");
+                nodeDescriptor
+                        .setDataSourceFactoryType(convertDataSourceFactory(dataSourceFactory));
                 nodeDescriptor.setSchemaUpdateStrategyType(attributes.getValue(
                         "",
                         "schema-update-strategy"));




</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (CAY-1231) Problem with CLOB field under Oracle</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c529175226.1260191418366.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c529175226-1260191418366-JavaMail-jira@brutus%3e</id>
<updated>2009-12-07T13:10:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Evgeny Ryabitskiy resolved CAY-1231.
------------------------------------

    Resolution: Fixed

Closing. Working properly with new driver.

&gt; Problem with CLOB field under Oracle
&gt; ------------------------------------
&gt;
&gt;                 Key: CAY-1231
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1231
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0 branch
&gt;         Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5 
&gt;            Reporter: Eugene Matyushkin
&gt;            Assignee: Andrus Adamchik
&gt;            Priority: Critical
&gt;             Fix For: 2.0.5
&gt;
&gt;         Attachments: CAY-1231_check.patch
&gt;
&gt;
&gt; 1. Creating table:
&gt; CREATE TABLE CRM_PDOCTYPECAT (
&gt;       PDOCTYPECATID     NUMERIC(19,0) NOT NULL,
&gt;       CATNAME           VARCHAR(255) NOT NULL,       
&gt;       CATDESCRIPTION    CLOB NULL                    	
&gt; );
&gt; 2. Creating named query
&gt; INSERT INTO CRM_PDOCTYPECAT(
&gt; 	PDOCTYPECATID,
&gt; 	CATNAME,
&gt; 	CATDESCRIPTION
&gt; ) VALUES (
&gt; 	#bind($PDOCTYPECATID 'NUMERIC'),
&gt; 	#bind($CATNAME 'VARCHAR'),
&gt;    	#bind($CATDESCRIPTION 'CLOB')
&gt; )
&gt; 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
&gt; 4. Executing query 
&gt; Result: 
&gt; 2009-05-28 13:32:03,053 [main] INFO  org.apache.cayenne.access.QueryLogger - *** error.
&gt; java.sql.SQLException: setString can process only strings less then 32766 symbols in
length
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
&gt; I guess, setClob should be used instead of setString when working with CLOBs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1231) Problem with CLOB field under Oracle</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c36132814.1260191298281.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c36132814-1260191298281-JavaMail-jira@brutus%3e</id>
<updated>2009-12-07T13:08:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Evgeny Ryabitskiy updated CAY-1231:
-----------------------------------

    Attachment: CAY-1231_check.patch

Was tested with latest Oracle Driver: version: 11.2.0.1.0  (ojdbc5_g-11.2.0.1.0.jar)
Working properly.
Even for 64 000 000 chars string.



&gt; Problem with CLOB field under Oracle
&gt; ------------------------------------
&gt;
&gt;                 Key: CAY-1231
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1231
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0 branch
&gt;         Environment: Oracle 10g, Cayenne 2.0.4, Java 1.5 
&gt;            Reporter: Eugene Matyushkin
&gt;            Assignee: Andrus Adamchik
&gt;            Priority: Critical
&gt;             Fix For: 2.0.5
&gt;
&gt;         Attachments: CAY-1231_check.patch
&gt;
&gt;
&gt; 1. Creating table:
&gt; CREATE TABLE CRM_PDOCTYPECAT (
&gt;       PDOCTYPECATID     NUMERIC(19,0) NOT NULL,
&gt;       CATNAME           VARCHAR(255) NOT NULL,       
&gt;       CATDESCRIPTION    CLOB NULL                    	
&gt; );
&gt; 2. Creating named query
&gt; INSERT INTO CRM_PDOCTYPECAT(
&gt; 	PDOCTYPECATID,
&gt; 	CATNAME,
&gt; 	CATDESCRIPTION
&gt; ) VALUES (
&gt; 	#bind($PDOCTYPECATID 'NUMERIC'),
&gt; 	#bind($CATNAME 'VARCHAR'),
&gt;    	#bind($CATDESCRIPTION 'CLOB')
&gt; )
&gt; 3. Binding very long (more then 32766 chars) string to CATDESCRIPTION.
&gt; 4. Executing query 
&gt; Result: 
&gt; 2009-05-28 13:32:03,053 [main] INFO  org.apache.cayenne.access.QueryLogger - *** error.
&gt; java.sql.SQLException: setString can process only strings less then 32766 symbols in
length
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
&gt; 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4588)
&gt; 	at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4559)
&gt; I guess, setClob should be used instead of setString when working with CLOBs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1471209411.1260186438166.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1471209411-1260186438166-JavaMail-jira@brutus%3e</id>
<updated>2009-12-07T11:47:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: CAY-1323_3.1.patch

Updated. + Some test coverage.
I think it's ready to commit

&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Evgeny Ryabitskiy
&gt;         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch,
cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1328) SQLTemplate for DataMap is not working</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c363267417.1260183918075.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c363267417-1260183918075-JavaMail-jira@brutus%3e</id>
<updated>2009-12-07T11:05:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Evgeny Ryabitskiy updated CAY-1328:
-----------------------------------

    Attachment: CAY-1328.patch

JUnit to show it

&gt; SQLTemplate for DataMap is not working
&gt; --------------------------------------
&gt;
&gt;                 Key: CAY-1328
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1328
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;         Environment: Cayenne 3.1 trunk
&gt;            Reporter: Evgeny Ryabitskiy
&gt;         Attachments: CAY-1328.patch
&gt;
&gt;
&gt; got:
&gt; java.lang.NullPointerException
&gt; 	at org.apache.cayenne.access.ObjectResolver.&lt;init&gt;(ObjectResolver.java:60)
&gt; 	at org.apache.cayenne.access.DataDomainQueryAction$ObjectConversionStrategy.toObjects(DataDomainQueryAction.java:568)
&gt; 	at org.apache.cayenne.access.DataDomainQueryAction$SingleObjectConversionStrategy.convert(DataDomainQueryAction.java:603)
&gt; 	at org.apache.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:451)
&gt; 	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:125)
&gt; 	at org.apache.cayenne.access.UnitTestDomainQueryAction.execute(UnitTestDomainQueryAction.java:48)
&gt; 	at org.apache.cayenne.access.UnitTestDomain.onQuery(UnitTestDomain.java:63)
&gt; 	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335)
&gt; 	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
&gt; 	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049)
&gt; 	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)
&gt; 	at org.apache.cayenne.query.SQLTemplateTest.testSQLTemplateForDataMapWithInsert(SQLTemplateTest.java:64)
&gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
&gt; 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
&gt; 	at java.lang.reflect.Method.invoke(Method.java:585)
&gt; 	at junit.framework.TestCase.runTest(TestCase.java:154)
&gt; 	at junit.framework.TestCase.runBare(TestCase.java:127)
&gt; 	at junit.framework.TestResult$1.protect(TestResult.java:106)
&gt; 	at junit.framework.TestResult.runProtected(TestResult.java:124)
&gt; 	at junit.framework.TestResult.run(TestResult.java:109)
&gt; 	at junit.framework.TestCase.run(TestCase.java:118)
&gt; 	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
&gt; 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
&gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
&gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
&gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
&gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (CAY-1328) SQLTemplate for DataMap is not working</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c69459919.1260183678692.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c69459919-1260183678692-JavaMail-jira@brutus%3e</id>
<updated>2009-12-07T11:01:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
SQLTemplate for DataMap is not working
--------------------------------------

                 Key: CAY-1328
                 URL: https://issues.apache.org/jira/browse/CAY-1328
             Project: Cayenne
          Issue Type: Bug
         Environment: Cayenne 3.1 trunk
            Reporter: Evgeny Ryabitskiy


got:

java.lang.NullPointerException
	at org.apache.cayenne.access.ObjectResolver.&lt;init&gt;(ObjectResolver.java:60)
	at org.apache.cayenne.access.DataDomainQueryAction$ObjectConversionStrategy.toObjects(DataDomainQueryAction.java:568)
	at org.apache.cayenne.access.DataDomainQueryAction$SingleObjectConversionStrategy.convert(DataDomainQueryAction.java:603)
	at org.apache.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:451)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:125)
	at org.apache.cayenne.access.UnitTestDomainQueryAction.execute(UnitTestDomainQueryAction.java:48)
	at org.apache.cayenne.access.UnitTestDomain.onQuery(UnitTestDomain.java:63)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)
	at org.apache.cayenne.query.SQLTemplateTest.testSQLTemplateForDataMapWithInsert(SQLTemplateTest.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Closed: (CAY-1319) Minimal DI container-based configuration to run Cayenne</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c526870070.1260139758359.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c526870070-1260139758359-JavaMail-jira@brutus%3e</id>
<updated>2009-12-06T22:49:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1319.
--------------------------------

    Resolution: Fixed

&gt; Minimal DI container-based configuration to run Cayenne 
&gt; --------------------------------------------------------
&gt;
&gt;                 Key: CAY-1319
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1319
&gt;             Project: Cayenne
&gt;          Issue Type: Task
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 3.1M1
&gt;            Reporter: Andrus Adamchik
&gt;            Assignee: Andrus Adamchik
&gt;             Fix For: 3.1M1
&gt;
&gt;
&gt; Need to implement loading of Cayenne runtime configuration via a DI mechanism. This will
include moving cayenne-di module from sandbox to Cayenne proper and using it to provide access
to DataDomain to the applications.
&gt; (this is very closely related to CAY-1318, as per CAY-1318 it is likely that in the future
Configuration class will be removed from Cayenne and a replacement needs to be provided)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887792 - /cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091206224830.9C13C23889CF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091206224830-9C13C23889CF@eris-apache-org%3e</id>
<updated>2009-12-06T22:48:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: aadamchik
Date: Sun Dec  6 22:48:29 2009
New Revision: 887792

URL: http://svn.apache.org/viewvc?rev=887792&amp;view=rev
Log:
CAY-1319 Switch Cayenne configuration loading to cayenne-di container

* release notes

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=887792&amp;r1=887791&amp;r2=887792&amp;view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Sun Dec  6 22:48:29 2009
@@ -18,6 +18,7 @@
 CAY-1314 Migrate Modeler Preferences to Java Preferences API: migrate org.apache.cayenne.modeler.ModelerPreferences
 CAY-1315 Formattable exceptions
 CAY-1316 Deprecate DataObjectUtils and move its methods to new utility class org.apache.cayenne.Cayenne
+CAY-1319 Minimal DI container-based configuration to run Cayenne
 
 Bug Fixes Since 3.0:
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887787 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/conf/ main/java/org/apache/cayenne/configuration/ test/java/org/apache/cayenne/configuration/ test/resources/org/apache/cayenne/configur...</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091206223334.7326C23889D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091206223334-7326C23889D0@eris-apache-org%3e</id>
<updated>2009-12-06T22:33:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: aadamchik
Date: Sun Dec  6 22:33:33 2009
New Revision: 887787

URL: http://svn.apache.org/viewvc?rev=887787&amp;view=rev
Log:
CAY-1319 Switch Cayenne configuration loading to cayenne-di container

* DBCPDataSourceFactory

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DBCPDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DBCPDataSourceFactoryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP.properties
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP_legacy.properties
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java?rev=887787&amp;r1=887786&amp;r2=887787&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
Sun Dec  6 22:33:33 2009
@@ -36,6 +36,7 @@
  * list of supported properties.
  * 
  * @since 1.2
+ * @deprecated since 3.1 replaced with {@link org.apache.cayenne.configuration.DBCPDataSourceFactory}
  */
 public class DBCPDataSourceFactory implements DataSourceFactory {
 

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DBCPDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DBCPDataSourceFactory.java?rev=887787&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DBCPDataSourceFactory.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DBCPDataSourceFactory.java
Sun Dec  6 22:33:33 2009
@@ -0,0 +1,108 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import javax.sql.DataSource;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.resource.Resource;
+import org.apache.cayenne.resource.ResourceLocator;
+import org.apache.commons.dbcp.BasicDataSourceFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * A {@link DataSourceFactory} based on DBCP connection pool library.
+ * 
+ * @since 3.1
+ */
+public class DBCPDataSourceFactory implements DataSourceFactory {
+
+    private static final Log logger = LogFactory.getLog(DBCPDataSourceFactory.class);
+
+    @Inject
+    protected ResourceLocator resourceLocator;
+
+    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) throws Exception {
+
+        Resource dbcpConfiguration = nodeDescriptor.getConfigurationResource();
+        if (dbcpConfiguration == null) {
+            throw new CayenneRuntimeException(
+                    "Null 'configurationResource' for nodeDescriptor '%s'",
+                    nodeDescriptor.getName());
+        }
+
+        Properties properties = getProperties(dbcpConfiguration);
+        if (logger.isDebugEnabled()) {
+            logger.debug("DBCP Properties: " + properties);
+        }
+
+        properties = filteredDeprecatedProperties(properties);
+        return BasicDataSourceFactory.createDataSource(properties);
+    }
+
+    /**
+     * Converts old-style cayene.dbcp.xyz properties to just cayenne.dbcp.
+     */
+    private Properties filteredDeprecatedProperties(Properties unfiltered) {
+        Properties properties = new Properties();
+
+        final String deprecatedPrefix = "cayenne.dbcp.";
+
+        for (Entry&lt;Object, Object&gt; entry : unfiltered.entrySet()) {
+            Object key = entry.getKey();
+            if (key instanceof String &amp;&amp; key.toString().startsWith(deprecatedPrefix))
{
+
+                String oldKey = key.toString();
+                key = oldKey.substring(deprecatedPrefix.length());
+                logger.info("Deprecated use of 'cayenne.dbcp.' prefix in '"
+                        + oldKey
+                        + "', converting to "
+                        + key);
+            }
+
+            properties.put(key, entry.getValue());
+        }
+
+        return properties;
+    }
+
+    private Properties getProperties(Resource dbcpConfiguration) throws IOException {
+        Properties properties = new Properties();
+        InputStream in = dbcpConfiguration.getURL().openStream();
+        try {
+            properties.load(in);
+        }
+        finally {
+            try {
+                in.close();
+            }
+            catch (IOException e) {
+            }
+        }
+
+        return properties;
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java?rev=887787&amp;r1=887786&amp;r2=887787&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
Sun Dec  6 22:33:33 2009
@@ -47,7 +47,7 @@
         }
 
         try {
-            return loadViaJNDI(location);
+            return lookupViaJNDI(location);
         }
         catch (Exception ex) {
             logger.info("failed JNDI lookup of DataSource location '" + location + "'");
@@ -56,7 +56,7 @@
         }
     }
 
-    DataSource loadViaJNDI(String location) throws NamingException {
+    DataSource lookupViaJNDI(String location) throws NamingException {
         QueryLogger.logConnect(location);
 
         Context context = new InitialContext();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java?rev=887787&amp;r1=887786&amp;r2=887787&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
Sun Dec  6 22:33:33 2009
@@ -177,7 +177,7 @@
                         "",
                         "schema-update-strategy"));
 
-                // this may be bogus for nodes other than driver nodes, but here we can't
+                // this may be bogus for some nodes, such as JNDI, but here we can't
                 // tell for sure
                 if (location != null) {
                     nodeDescriptor.setConfigurationResource(descriptor

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DBCPDataSourceFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DBCPDataSourceFactoryTest.java?rev=887787&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DBCPDataSourceFactoryTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DBCPDataSourceFactoryTest.java
Sun Dec  6 22:33:33 2009
@@ -0,0 +1,110 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.sql.DataSource;
+
+import junit.framework.TestCase;
+
+import org.apache.cayenne.resource.URLResource;
+import org.apache.commons.dbcp.BasicDataSource;
+
+public class DBCPDataSourceFactoryTest extends TestCase {
+
+    public void testGetDataSource() throws Exception {
+
+        String baseUrl = getClass().getPackage().getName().replace('.', '/');
+        URL url = getClass().getClassLoader().getResource(
+                baseUrl + "/testDBCP.properties");
+        assertNotNull(url);
+
+        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
+        nodeDescriptor.setConfigurationResource(new URLResource(url));
+
+        DBCPDataSourceFactory factory = new DBCPDataSourceFactory();
+        DataSource dataSource = factory.getDataSource(nodeDescriptor);
+        assertNotNull(dataSource);
+
+        assertTrue(dataSource instanceof BasicDataSource);
+        BasicDataSource basicDataSource = (BasicDataSource) dataSource;
+        assertEquals("com.example.jdbc.Driver", basicDataSource.getDriverClassName());
+        assertEquals("jdbc:somedb://localhost/cayenne", basicDataSource.getUrl());
+        assertEquals("john", basicDataSource.getUsername());
+        assertEquals("secret", basicDataSource.getPassword());
+        assertEquals(20, basicDataSource.getMaxActive());
+        assertEquals(5, basicDataSource.getMinIdle());
+        assertEquals(8, basicDataSource.getMaxIdle());
+        assertEquals(10000, basicDataSource.getMaxWait());
+        assertEquals("select 1 from xyz;", basicDataSource.getValidationQuery());
+    }
+    
+    public void testGetDataSource_LegacyConfig() throws Exception {
+
+        String baseUrl = getClass().getPackage().getName().replace('.', '/');
+        URL url = getClass().getClassLoader().getResource(
+                baseUrl + "/testDBCP_legacy.properties");
+        assertNotNull(url);
+
+        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
+        nodeDescriptor.setConfigurationResource(new URLResource(url));
+
+        DBCPDataSourceFactory factory = new DBCPDataSourceFactory();
+        DataSource dataSource = factory.getDataSource(nodeDescriptor);
+        assertNotNull(dataSource);
+
+        assertTrue(dataSource instanceof BasicDataSource);
+        BasicDataSource basicDataSource = (BasicDataSource) dataSource;
+        assertEquals("com.example.jdbc.Driver", basicDataSource.getDriverClassName());
+        assertEquals("jdbc:somedb://localhost/cayenne", basicDataSource.getUrl());
+        assertEquals("john", basicDataSource.getUsername());
+        assertEquals("secret", basicDataSource.getPassword());
+        assertEquals(20, basicDataSource.getMaxActive());
+        assertEquals(5, basicDataSource.getMinIdle());
+        assertEquals(8, basicDataSource.getMaxIdle());
+        assertEquals(10000, basicDataSource.getMaxWait());
+        assertEquals("select 1 from xyz;", basicDataSource.getValidationQuery());
+    }
+
+    public void testGetDataSource_InvalidLocation() throws Exception {
+
+        String baseUrl = getClass().getPackage().getName().replace('.', '/');
+        URL url = getClass().getClassLoader().getResource(
+                baseUrl + "/testDBCP.properties");
+        assertNotNull(url);
+        url = new URL(url, ".nosuchfile");
+
+        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
+        nodeDescriptor.setConfigurationResource(new URLResource(url));
+
+        DBCPDataSourceFactory factory = new DBCPDataSourceFactory();
+
+        try {
+            factory.getDataSource(nodeDescriptor);
+            fail("didn't throw on abscent config file");
+        }
+        catch (IOException ex) {
+            // expected
+        }
+
+    }
+
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP.properties
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP.properties?rev=887787&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP.properties
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP.properties
Sun Dec  6 22:33:33 2009
@@ -0,0 +1,9 @@
+driverClassName=com.example.jdbc.Driver
+url=jdbc:somedb://localhost/cayenne
+username=john
+password=secret
+maxActive=20
+minIdle=5
+maxIdle=8
+maxWait=10000
+validationQuery=select 1 from xyz;
\ No newline at end of file

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP_legacy.properties
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP_legacy.properties?rev=887787&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP_legacy.properties
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testDBCP_legacy.properties
Sun Dec  6 22:33:33 2009
@@ -0,0 +1,10 @@
+# DBCPDataSourceFactory properties for Cayenne &lt; 3.1
+cayenne.dbcp.driverClassName=com.example.jdbc.Driver
+cayenne.dbcp.url=jdbc:somedb://localhost/cayenne
+cayenne.dbcp.username=john
+cayenne.dbcp.password=secret
+cayenne.dbcp.maxActive=20
+cayenne.dbcp.minIdle=5
+cayenne.dbcp.maxIdle=8
+cayenne.dbcp.maxWait=10000
+cayenne.dbcp.validationQuery=select 1 from xyz;
\ No newline at end of file




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887685 - in /cayenne/main/trunk: ./ framework/cayenne-jdk1.5-unpublished/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/ fram...</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091206141443.C1C372388998@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091206141443-C1C372388998@eris-apache-org%3e</id>
<updated>2009-12-06T14:14:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: aadamchik
Date: Sun Dec  6 14:14:42 2009
New Revision: 887685

URL: http://svn.apache.org/viewvc?rev=887685&amp;view=rev
Log:
CAY-1319 Switch Cayenne configuration loading to cayenne-di container

* JNDIDataSourceProvider

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/JNDIDataSourceFactoryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/JNDISetup.java
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/pom.xml
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java
    cayenne/main/trunk/pom.xml

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/pom.xml?rev=887685&amp;r1=887684&amp;r2=887685&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/pom.xml (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/pom.xml Sun Dec  6 14:14:42 2009
@@ -57,6 +57,10 @@
 			&lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
 		&lt;/dependency&gt;
 		&lt;dependency&gt;
+			&lt;groupId&gt;org.springframework&lt;/groupId&gt;
+			&lt;artifactId&gt;spring-mock&lt;/artifactId&gt;
+		&lt;/dependency&gt;
+		&lt;dependency&gt;
 			&lt;groupId&gt;com.caucho&lt;/groupId&gt;
 			&lt;artifactId&gt;resin-hessian&lt;/artifactId&gt;
 		&lt;/dependency&gt;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java?rev=887685&amp;r1=887684&amp;r2=887685&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java
Sun Dec  6 14:14:42 2009
@@ -32,6 +32,8 @@
 /**
  * Looks up DataSource objects via JNDI.
  * 
+ * @deprecated since 3.1, replaced by
+ *             {@link org.apache.cayenne.configuration.JNDIDataSourceFactory}.
  */
 public class JNDIDataSourceFactory implements DataSourceFactory {
 
@@ -97,9 +99,10 @@
         // reflection ...
 
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
-        DataSourceFactory prefsFactory = (DataSourceFactory) Class
-                .forName("org.apache.cayenne.modeler.pref.PreferencesDataSourceFactory",
true, loader)
-                .newInstance();
+        DataSourceFactory prefsFactory = (DataSourceFactory) Class.forName(
+                "org.apache.cayenne.modeler.pref.PreferencesDataSourceFactory",
+                true,
+                loader).newInstance();
 
         prefsFactory.initializeWithParentConfiguration(parentConfig);
         return prefsFactory.getDataSource(location);

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java?rev=887685&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/JNDIDataSourceFactory.java
Sun Dec  6 14:14:42 2009
@@ -0,0 +1,77 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.access.QueryLogger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Locates DataSource mapped via JNDI.
+ * 
+ * @since 3.1
+ */
+public class JNDIDataSourceFactory implements DataSourceFactory {
+
+    private static final Log logger = LogFactory.getLog(JNDIDataSourceFactory.class);
+
+    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) throws Exception {
+
+        String location = nodeDescriptor.getLocation();
+        if (location == null) {
+            throw new CayenneRuntimeException(
+                    "Null 'location' for nodeDescriptor '%s'",
+                    nodeDescriptor.getName());
+        }
+
+        try {
+            return loadViaJNDI(location);
+        }
+        catch (Exception ex) {
+            logger.info("failed JNDI lookup of DataSource location '" + location + "'");
+            QueryLogger.logConnectFailure(ex);
+            throw ex;
+        }
+    }
+
+    DataSource loadViaJNDI(String location) throws NamingException {
+        QueryLogger.logConnect(location);
+
+        Context context = new InitialContext();
+        DataSource dataSource;
+        try {
+            Context envContext = (Context) context.lookup("java:comp/env");
+            dataSource = (DataSource) envContext.lookup(location);
+        }
+        catch (NamingException namingEx) {
+            // try looking up the location directly...
+            dataSource = (DataSource) context.lookup(location);
+        }
+
+        QueryLogger.logConnectSuccess();
+        return dataSource;
+    }
+
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/JNDIDataSourceFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/JNDIDataSourceFactoryTest.java?rev=887685&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/JNDIDataSourceFactoryTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/JNDIDataSourceFactoryTest.java
Sun Dec  6 14:14:42 2009
@@ -0,0 +1,93 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+
+import junit.framework.TestCase;
+
+import org.apache.cayenne.unit.JNDISetup;
+
+import com.mockrunner.mock.jdbc.MockDataSource;
+
+public class JNDIDataSourceFactoryTest extends TestCase {
+
+    public void testGetDataSource_NameBound() throws Exception {
+
+        DataNodeDescriptor descriptor = new DataNodeDescriptor();
+        descriptor.setLocation("jdbc/TestDS");
+
+        JNDISetup.doSetup();
+
+        MockDataSource dataSource = new MockDataSource();
+        InitialContext context = new InitialContext();
+        context.bind(descriptor.getLocation(), dataSource);
+
+        try {
+
+            JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
+            assertSame(dataSource, factory.getDataSource(descriptor));
+        }
+        finally {
+            // since the context is shared, must clear it after the test
+            context.unbind(descriptor.getLocation());
+        }
+    }
+
+    public void testGetDataSource_NameBoundWithPrefix() throws Exception {
+
+        DataNodeDescriptor descriptor = new DataNodeDescriptor();
+        descriptor.setLocation("jdbc/TestDS");
+
+        JNDISetup.doSetup();
+
+        MockDataSource dataSource = new MockDataSource();
+        InitialContext context = new InitialContext();
+        context.bind("java:comp/env/" + descriptor.getLocation(), dataSource);
+
+        try {
+
+            JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
+            assertSame(dataSource, factory.getDataSource(descriptor));
+        }
+        finally {
+            // since the context is shared, must clear it after the test
+            context.unbind("java:comp/env/" + descriptor.getLocation());
+        }
+    }
+
+    public void testGetDataSource_NameNotBound() throws Exception {
+
+        DataNodeDescriptor descriptor = new DataNodeDescriptor();
+        descriptor.setLocation("jdbc/TestDS");
+
+        JNDISetup.doSetup();
+
+        JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
+
+        try {
+            factory.getDataSource(descriptor);
+            fail("Didn't throw on unbound name");
+        }
+        catch (NameNotFoundException e) {
+            // expected
+        }
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/JNDISetup.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/JNDISetup.java?rev=887685&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/JNDISetup.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/JNDISetup.java
Sun Dec  6 14:14:42 2009
@@ -0,0 +1,57 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.unit;
+
+import javax.naming.NamingException;
+import javax.naming.spi.NamingManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.mock.jndi.SimpleNamingContextBuilder;
+
+/**
+ * A helper class to setup a shared test JNDI environment.
+ */
+public class JNDISetup {
+
+    private static Log logger = LogFactory.getLog(JNDISetup.class);
+
+    private static volatile boolean setup;
+
+    public static void doSetup() {
+        if (!setup) {
+
+            synchronized (JNDISetup.class) {
+
+                if (!setup) {
+                    try {
+                        NamingManager
+                                .setInitialContextFactoryBuilder(new SimpleNamingContextBuilder());
+                    }
+                    catch (NamingException e) {
+                        logger.error("Can't perform JNDI setup, ignoring...", e);
+                    }
+
+                    setup = true;
+                }
+            }
+        }
+    }
+
+}

Modified: cayenne/main/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/pom.xml?rev=887685&amp;r1=887684&amp;r2=887685&amp;view=diff
==============================================================================
--- cayenne/main/trunk/pom.xml (original)
+++ cayenne/main/trunk/pom.xml Sun Dec  6 14:14:42 2009
@@ -497,6 +497,13 @@
 				&lt;version&gt;1.2.6&lt;/version&gt;
 				&lt;scope&gt;test&lt;/scope&gt;
 			&lt;/dependency&gt;
+			
+			&lt;dependency&gt;
+			    &lt;groupId&gt;org.springframework&lt;/groupId&gt;
+			    &lt;artifactId&gt;spring-mock&lt;/artifactId&gt;
+			    &lt;version&gt;2.0.8&lt;/version&gt;
+			    &lt;scope&gt;test&lt;/scope&gt;
+			&lt;/dependency&gt;
 
 			&lt;dependency&gt;
 				&lt;groupId&gt;velocity&lt;/groupId&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1318) Cayenne configuration to support a single DataDomain</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c190979438.1260104058136.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c190979438-1260104058136-JavaMail-jira@brutus%3e</id>
<updated>2009-12-06T12:54:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik updated CAY-1318:
---------------------------------

    Attachment: 0001-CAY-1318-Cayenne-configuration-to-support-a-single-D.patch

attaching patch for archival purposes... this task is waiting for CAY-1319 to be finished

&gt; Cayenne configuration to support a single DataDomain
&gt; ----------------------------------------------------
&gt;
&gt;                 Key: CAY-1318
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1318
&gt;             Project: Cayenne
&gt;          Issue Type: Task
&gt;          Components: Cayenne Core Library, CayenneModeler GUI
&gt;    Affects Versions: 3.1M1
&gt;            Reporter: Andrus Adamchik
&gt;            Assignee: Andrus Adamchik
&gt;             Fix For: 3.1M1
&gt;
&gt;         Attachments: 0001-CAY-1318-Cayenne-configuration-to-support-a-single-D.patch
&gt;
&gt;
&gt; Multi-datadomain runtime configurations offer no advantage over multiple configurations
with a single domain each. So going to change the project structure to only support a single
DataDomain. A Modeler will have project upgrader that will split multi-domain projects into
multiple single domain projects (e.g. cayenne1.xml, cayenne2.xml, etc).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1319) Minimal DI container-based configuration to run Cayenne</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c979155407.1260098958062.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c979155407-1260098958062-JavaMail-jira@brutus%3e</id>
<updated>2009-12-06T11:29:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik updated CAY-1319:
---------------------------------

    Description: 
Need to implement loading of Cayenne runtime configuration via a DI mechanism. This will include
moving cayenne-di module from sandbox to Cayenne proper and using it to provide access to
DataDomain to the applications.

(this is very closely related to CAY-1318, as per CAY-1318 it is likely that in the future
Configuration class will be removed from Cayenne and a replacement needs to be provided)



  was:
Need to implement loading of Cayenne runtime (and Modeler?) configuration via a DI mechanism.
This will include moving cayenne-di module from sandbox to Cayenne proper and using it to
provide access to DataDomain to the applications.

(this is very closely related to CAY-1318, as per CAY-1318 it is likely that Configuration
class will be removed from Cayenne and a replacement needs to be provided)



        Summary: Minimal DI container-based configuration to run Cayenne   (was: Switch Cayenne
configuration loading to cayenne-di container)

(renaming the issue, as it is about implementing a DI-based stack... Making it a default in
 Cayenne is a separate task.

&gt; Minimal DI container-based configuration to run Cayenne 
&gt; --------------------------------------------------------
&gt;
&gt;                 Key: CAY-1319
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1319
&gt;             Project: Cayenne
&gt;          Issue Type: Task
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 3.1M1
&gt;            Reporter: Andrus Adamchik
&gt;            Assignee: Andrus Adamchik
&gt;             Fix For: 3.1M1
&gt;
&gt;
&gt; Need to implement loading of Cayenne runtime configuration via a DI mechanism. This will
include moving cayenne-di module from sandbox to Cayenne proper and using it to provide access
to DataDomain to the applications.
&gt; (this is very closely related to CAY-1318, as per CAY-1318 it is likely that in the future
Configuration class will be removed from Cayenne and a replacement needs to be provided)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1319) Switch Cayenne configuration loading to cayenne-di container</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1678317654.1260098838072.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1678317654-1260098838072-JavaMail-jira@brutus%3e</id>
<updated>2009-12-06T11:27:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik updated CAY-1319:
---------------------------------

    Attachment:     (was: 0001-CAY-1318-Cayenne-configuration-to-support-a-single-D.patch)

&gt; Switch Cayenne configuration loading to cayenne-di container
&gt; ------------------------------------------------------------
&gt;
&gt;                 Key: CAY-1319
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1319
&gt;             Project: Cayenne
&gt;          Issue Type: Task
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 3.1M1
&gt;            Reporter: Andrus Adamchik
&gt;            Assignee: Andrus Adamchik
&gt;             Fix For: 3.1M1
&gt;
&gt;
&gt; Need to implement loading of Cayenne runtime (and Modeler?) configuration via a DI mechanism.
This will include moving cayenne-di module from sandbox to Cayenne proper and using it to
provide access to DataDomain to the applications.
&gt; (this is very closely related to CAY-1318, as per CAY-1318 it is likely that Configuration
class will be removed from Cayenne and a replacement needs to be provided)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887668 - in /cayenne/main/trunk: framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/dbsync/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/ framework/cayenne-jdk1.5-unpublished...</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091206112321.AB2B7238899B@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091206112321-AB2B7238899B@eris-apache-org%3e</id>
<updated>2009-12-06T11:23:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: aadamchik
Date: Sun Dec  6 11:23:18 2009
New Revision: 887668

URL: http://svn.apache.org/viewvc?rev=887668&amp;view=rev
Log:
CAY-1319 Switch Cayenne configuration loading to cayenne-di container

* DataContextProvider
* CayenneRuntime -&gt; CayenneServerRuntime
* CayenneServerRuntime itests

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneServerModule.java
      - copied, changed from r887667, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DomainDataChannelProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntime.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataContextProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeTest.java
      - copied, changed from r887667, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneRuntimeTest.java
    cayenne/main/trunk/itests/cayenne-di-stack/
    cayenne/main/trunk/itests/cayenne-di-stack/.classpath
    cayenne/main/trunk/itests/cayenne-di-stack/.project
    cayenne/main/trunk/itests/cayenne-di-stack/.settings/
    cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.eclipse.jdt.core.prefs
    cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.maven.ide.eclipse.prefs
    cayenne/main/trunk/itests/cayenne-di-stack/pom.xml
      - copied, changed from r887667, cayenne/main/trunk/itests/pom.xml
    cayenne/main/trunk/itests/cayenne-di-stack/src/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/DefaultMap.java
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/Table1.java
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_DefaultMap.java
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_Table1.java
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntimeCase.java
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/RuntimeName.java
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/DefaultMap.map.xml
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/PoolingDSNode.driver.xml
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/cayenne-DEFAULT.xml
    cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/log4j.properties
    cayenne/main/trunk/itests/cayenne-di-stack/src/test/
    cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/
    cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/
    cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/
    cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/
    cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/
    cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java
Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneRuntimeTest.java
    cayenne/main/trunk/framework/cayenne-server/pom.properties
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/dbsync/CreateIfNoSchemaStrategy.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/SAXNestedTagHandler.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoader.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneRuntime.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java
    cayenne/main/trunk/itests/pom.xml

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/dbsync/CreateIfNoSchemaStrategy.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/dbsync/CreateIfNoSchemaStrategy.java?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/dbsync/CreateIfNoSchemaStrategy.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/dbsync/CreateIfNoSchemaStrategy.java Sun Dec  6 11:23:18 2009
@@ -42,7 +42,7 @@
     final static Log logger = LogFactory.getLog(CreateIfNoSchemaStrategy.class);
 
     @Override
-    public void processSchemaUpdate(DataNode dataNode) throws SQLException {
+    protected void processSchemaUpdate(DataNode dataNode) throws SQLException {
 
         Map&lt;String, Boolean&gt; nameTables = getNameTablesInDB(dataNode);
         Collection&lt;DbEntity&gt; entities = dataNode.getEntityResolver().getDbEntities();

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneServerModule.java (from r887667, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneServerModule.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneServerModule.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java&amp;r1=887667&amp;r2=887668&amp;rev=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneServerModule.java Sun Dec  6 11:23:18 2009
@@ -19,9 +19,10 @@
 package org.apache.cayenne.configuration;
 
 import org.apache.cayenne.DataChannel;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.db2.DB2Sniffer;
 import org.apache.cayenne.dba.derby.DerbySniffer;
 import org.apache.cayenne.dba.frontbase.FrontBaseSniffer;
@@ -41,20 +42,21 @@
 import org.apache.cayenne.resource.ClassLoaderResourceLocator;
 import org.apache.cayenne.resource.ResourceLocator;
 import org.apache.cayenne.runtime.CayenneRuntime;
+import org.apache.cayenne.runtime.DataContextProvider;
 import org.apache.cayenne.runtime.DataDomainProvider;
 
 /**
- * A DI module containing all Cayenne runtime configurations. To customize Cayenne runtime
- * configuration, either extend this module, or supply an extra custom module when
+ * A DI module containing all Cayenne server runtime configurations. To customize Cayenne
+ * runtime configuration, either extend this module, or supply an extra custom module when
  * creating {@link CayenneRuntime}.
  * 
  * @since 3.1
  */
-public class CayenneModule implements Module {
+public class CayenneServerModule implements Module {
 
     protected String runtimeName;
 
-    public CayenneModule(String runtimeName) {
+    public CayenneServerModule(String runtimeName) {
         this.runtimeName = runtimeName;
     }
 
@@ -68,7 +70,7 @@
         // configure known DbAdapter detectors in reverse order of popularity. Users can
         // add their own for their own to install custom adapters automatically
         binder
-                .bindList(DbAdapter.class)
+                .bindList(DbAdapterFactory.class)
                 .add(new OpenBaseSniffer())
                 .add(new FrontBaseSniffer())
                 .add(new IngresSniffer())
@@ -86,8 +88,13 @@
         binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class).in(
                 Scopes.SINGLETON);
 
-        // a service to provide the main stack DataChannel
-        binder.bind(DataChannel.class).toProvider(DataDomainProvider.class);
+        // a service to provide the main stack DataDomain
+        binder.bind(DataDomain.class).toProvider(DataDomainProvider.class).in(Scopes.SINGLETON);
+
+        // will return DataDomain for request for a DataChannel
+        binder.bind(DataChannel.class).toProvider(DomainDataChannelProvider.class).in(Scopes.SINGLETON);
+        
+        binder.bind(ObjectContext.class).toProvider(DataContextProvider.class);
 
         // a service to load project XML descriptors
         binder.bind(DataChannelDescriptorLoader.class).to(

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DomainDataChannelProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DomainDataChannelProvider.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DomainDataChannelProvider.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DomainDataChannelProvider.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,41 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import org.apache.cayenne.DataChannel;
+import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.di.DIException;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Provider;
+
+/**
+ * This is a default implementation of a DataChannel provider that simply returns a
+ * DataDomain for a given runtime.
+ * 
+ * @since 3.1
+ */
+public class DomainDataChannelProvider implements Provider&lt;DataChannel&gt; {
+
+    @Inject
+    protected DataDomain dataDomain;
+    
+    public DataChannel get() throws DIException {
+        return dataDomain;
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/SAXNestedTagHandler.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/SAXNestedTagHandler.java?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/SAXNestedTagHandler.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/SAXNestedTagHandler.java Sun Dec  6 11:23:18 2009
@@ -18,6 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.configuration;
 
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.Locator;
@@ -68,6 +72,21 @@
         }
     }
 
+    protected String unexpectedTagMessage(String tagFound, String... tagsExpected) {
+
+        List&lt;String&gt; expected = tagsExpected != null
+                ? Arrays.asList(tagsExpected)
+                : Collections.&lt;String&gt; emptyList();
+
+        return String
+                .format(
+                        "tag &lt;%s&gt; is unexpected at [%d,%d]. The following tags are allowed here: %s",
+                        tagFound,
+                        locator.getColumnNumber(),
+                        locator.getLineNumber(),
+                        expected);
+    }
+
     protected ContentHandler createChildTagHandler(
             String namespaceURI,
             String localName,

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoader.java?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoader.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoader.java Sun Dec  6 11:23:18 2009
@@ -50,7 +50,10 @@
 
     public DataChannelDescriptor load(String runtimeName) throws CayenneRuntimeException {
 
-        logger.debug("starting configuration loading: " + runtimeName);
+        long t0 = System.currentTimeMillis();
+        if (logger.isDebugEnabled()) {
+            logger.debug("starting configuration loading: " + runtimeName);
+        }
 
         String resourceName = getResourceName(runtimeName);
         Collection&lt;Resource&gt; configurations = resourceLocator.findResources(resourceName);
@@ -73,11 +76,20 @@
         }
 
         DataChannelDescriptor descriptor = new XMLDataChannelDescriptorLoaderAction(
-                dataMapLoader).load(configurationResource);
+                dataMapLoader,
+                logger).load(configurationResource);
 
         descriptor.setName(runtimeName);
 
-        logger.debug("finished configuration loading: " + runtimeName);
+        long t1 = System.currentTimeMillis();
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("finished configuration loading: "
+                    + runtimeName
+                    + " in "
+                    + (t1 - t0)
+                    + " ms.");
+        }
         return descriptor;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLDataChannelDescriptorLoaderAction.java Sun Dec  6 11:23:18 2009
@@ -27,7 +27,6 @@
 import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.util.Util;
 import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.InputSource;
@@ -41,9 +40,6 @@
  */
 class XMLDataChannelDescriptorLoaderAction {
 
-    private static Log logger = LogFactory
-            .getLog(XMLDataChannelDescriptorLoaderAction.class);
-
     static final String DOMAIN_TAG = "domain";
     static final String MAP_TAG = "map";
     static final String NODE_TAG = "node";
@@ -51,9 +47,11 @@
     static final String MAP_REF_TAG = "map-ref";
 
     private DataMapLoader mapLoader;
+    private Log logger;
 
-    XMLDataChannelDescriptorLoaderAction(DataMapLoader mapLoader) {
+    XMLDataChannelDescriptorLoaderAction(DataMapLoader mapLoader, Log logger) {
         this.mapLoader = mapLoader;
+        this.logger = logger;
     }
 
     DataChannelDescriptor load(Resource resource) {
@@ -118,6 +116,7 @@
                 return new DataChannelChildrenHandler(parser, this);
             }
 
+            logger.info(unexpectedTagMessage(localName, DOMAIN_TAG));
             return super.createChildTagHandler(namespaceURI, localName, name, atts);
         }
     }
@@ -172,9 +171,8 @@
                 String location = attributes.getValue("", "datasource");
                 nodeDescriptor.setLocation(location);
 
-                nodeDescriptor.setDataSourceFactoryType(attributes.getValue(
-                        "",
-                        "factory"));
+                nodeDescriptor.setDataSourceFactoryType(attributes
+                        .getValue("", "factory"));
                 nodeDescriptor.setSchemaUpdateStrategyType(attributes.getValue(
                         "",
                         "schema-update-strategy"));

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneRuntime.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneRuntime.java?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneRuntime.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneRuntime.java Sun Dec  6 11:23:18 2009
@@ -20,37 +20,24 @@
 
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.configuration.CayenneModule;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Module;
 
 /**
- * Represents the main access point to a given Cayenne stack. Provides a default Cayenne
- * configuration as well as a way to customize this configuration via a built in
- * dependency injection container.
+ * A superclass of possible Cayenne runtime objects. A CayenneRuntime is the main access
+ * point to a given Cayenne stack. It provides a default Cayenne configuration as well as
+ * a way to customize this configuration via a built in dependency injection container.
  * 
  * @since 3.1
  */
-public class CayenneRuntime {
+public abstract class CayenneRuntime {
 
     protected String name;
     protected Injector injector;
     protected Module[] modules;
 
     /**
-     * Initializes Cayenne runtime instance with a default configuration provided by
-     * {@link CayenneModule}.
-     * 
-     * @param name Runtime name. By default a configuration file name contains a runtime
-     *            name in it, to allow multiple runtimes in a single JVM. E.g. a typical
-     *            config file name has the form of "cayenne-&lt;name&gt;.xml".
-     */
-    public CayenneRuntime(String name) {
-        this(name, new CayenneModule(name));
-    }
-
-    /**
      * Initializes Cayenne runtime with an array of DI modules.
      */
     public CayenneRuntime(String name, Module... modules) {
@@ -94,7 +81,7 @@
     /**
      * Creates and returns an ObjectContext based on the runtime DataChannel.
      */
-    public ObjectContext newObjectContext() {
+    public ObjectContext newContext() {
         return injector.getInstance(ObjectContext.class);
     }
 }

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntime.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntime.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntime.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntime.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,52 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.runtime;
+
+import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.CayenneServerModule;
+import org.apache.cayenne.di.Module;
+
+/**
+ * A runtime representing Cayenne server-stack that connects directly to the database via
+ * JDBC. The term "server" is used as opposed to ROP "client". Any application, desktop,
+ * server, etc. that has a direct JDBC connection should be using this runtime.
+ * 
+ * @since 3.1
+ */
+public class CayenneServerRuntime extends CayenneRuntime {
+
+    public CayenneServerRuntime(String name) {
+        super(name, new CayenneServerModule(name));
+    }
+
+    public CayenneServerRuntime(String name, Module... modules) {
+        super(name, modules);
+    }
+
+    /**
+     * Returns the main runtime DataDomain. Note that by default the returned DataDomain
+     * is the same as the main DataChannel returned by {@link #getDataChannel()}. Although
+     * users may redefine DataChannel provider in the DI registry, for instance to
+     * decorate this DataDomain with a custom wrapper.
+     */
+    public DataDomain getDataDomain() {
+        return injector.getInstance(DataDomain.class);
+    }
+
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataContextProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataContextProvider.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataContextProvider.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataContextProvider.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,40 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.runtime;
+
+import org.apache.cayenne.access.DataContext;
+import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.di.DIException;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Provider;
+
+/**
+ * @since 3.1
+ */
+public class DataContextProvider implements Provider&lt;DataContext&gt; {
+
+    @Inject
+    protected DataDomain dataDomain;
+
+    public DataContext get() throws DIException {
+        // TODO: andrus 12.5.2009 - deprecate 'createDataContext' in DataDomain and move
+        // it to this provider instead
+        return dataDomain.createDataContext();
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java Sun Dec  6 11:23:18 2009
@@ -43,7 +43,7 @@
  * 
  * @since 3.1
  */
-public class DataDomainProvider implements Provider&lt;DataChannel&gt; {
+public class DataDomainProvider implements Provider&lt;DataDomain&gt; {
 
     @Inject
     protected DataChannelDescriptorLoader loader;
@@ -63,13 +63,13 @@
     @Inject
     protected AdhocObjectFactory objectFactory;
 
-    protected volatile DataChannel dataChannel;
+    protected volatile DataDomain dataDomain;
 
-    public DataChannel get() throws DIException {
+    public DataDomain get() throws DIException {
 
-        if (dataChannel == null) {
+        if (dataDomain == null) {
             synchronized (this) {
-                if (dataChannel == null) {
+                if (dataDomain == null) {
 
                     try {
                         createDataChannel();
@@ -85,7 +85,7 @@
             }
         }
 
-        return dataChannel;
+        return dataDomain;
     }
 
     protected void createDataChannel() throws Exception {
@@ -93,12 +93,12 @@
                 .get(RuntimeProperties.CAYENNE_RUNTIME_NAME);
         DataChannelDescriptor descriptor = loader.load(runtimeName);
 
-        DataDomain dataChannel = new DataDomain(descriptor.getName());
+        DataDomain dataDomain = new DataDomain(descriptor.getName());
 
-        dataChannel.initWithProperties(descriptor.getProperties());
+        dataDomain.initWithProperties(descriptor.getProperties());
 
         for (DataMap dataMap : descriptor.getDataMaps()) {
-            dataChannel.addMap(dataMap);
+            dataDomain.addMap(dataMap);
         }
 
         for (DataNodeDescriptor nodeDescriptor : descriptor.getDataNodeDescriptors()) {
@@ -138,13 +138,13 @@
 
             // DataMaps
             for (String dataMapName : nodeDescriptor.getDataMapNames()) {
-                dataNode.addDataMap(dataChannel.getMap(dataMapName));
+                dataNode.addDataMap(dataDomain.getMap(dataMapName));
             }
 
-            dataChannel.addNode(dataNode);
+            dataDomain.addNode(dataNode);
         }
 
-        this.dataChannel = dataChannel;
+        this.dataDomain = dataDomain;
     }
 
 }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeTest.java (from r887667, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneRuntimeTest.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeTest.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeTest.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneRuntimeTest.java&amp;r1=887667&amp;r2=887668&amp;rev=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneRuntimeTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeTest.java Sun Dec  6 11:23:18 2009
@@ -24,24 +24,23 @@
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.QueryResponse;
 import org.apache.cayenne.access.DataContext;
-import org.apache.cayenne.configuration.CayenneModule;
+import org.apache.cayenne.configuration.CayenneServerModule;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.graph.GraphDiff;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
-import org.apache.cayenne.runtime.CayenneRuntime;
 
-public class CayenneRuntimeTest extends TestCase {
+public class CayenneServerRuntimeTest extends TestCase {
 
     public void testDefaultConstructor() {
-        CayenneRuntime runtime = new CayenneRuntime("xxxx");
+        CayenneServerRuntime runtime = new CayenneServerRuntime("xxxx");
 
         assertEquals("xxxx", runtime.getName());
 
         assertEquals(1, runtime.getModules().length);
-        assertTrue(runtime.getModules()[0] instanceof CayenneModule);
+        assertTrue(runtime.getModules()[0] instanceof CayenneServerModule);
     }
 
     public void testConstructor_Modules() {
@@ -62,7 +61,7 @@
             }
         };
 
-        CayenneRuntime runtime = new CayenneRuntime("yyyy", m1, m2);
+        CayenneServerRuntime runtime = new CayenneServerRuntime("yyyy", m1, m2);
 
         assertEquals("yyyy", runtime.getName());
         assertEquals(2, runtime.getModules().length);
@@ -102,7 +101,7 @@
             }
         };
 
-        CayenneRuntime runtime = new CayenneRuntime("name", module);
+        CayenneServerRuntime runtime = new CayenneServerRuntime("name", module);
         assertSame(channel, runtime.getDataChannel());
     }
 
@@ -116,8 +115,8 @@
             }
         };
 
-        CayenneRuntime runtime = new CayenneRuntime("name", module);
-        assertSame(context, runtime.newObjectContext());
-        assertSame(context, runtime.newObjectContext());
+        CayenneServerRuntime runtime = new CayenneServerRuntime("name", module);
+        assertSame(context, runtime.newContext());
+        assertSame(context, runtime.newContext());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java Sun Dec  6 11:23:18 2009
@@ -18,8 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.runtime;
 
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
 import java.util.Collections;
 
 import javax.sql.DataSource;
@@ -38,14 +36,14 @@
 import org.apache.cayenne.configuration.DataChannelDescriptorLoader;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.configuration.DataSourceFactoryLoader;
+import org.apache.cayenne.configuration.DbAdapterFactory;
 import org.apache.cayenne.configuration.DefaultAdhocObjectFactory;
 import org.apache.cayenne.configuration.DefaultRuntimeProperties;
 import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.configuration.mock.MockDataSourceFactory;
 import org.apache.cayenne.configuration.mock.MockDataSourceFactoryLoader;
-import org.apache.cayenne.dba.AutoAdapter;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dba.DbAdapterFactory;
+import org.apache.cayenne.dba.MockDbAdapter;
 import org.apache.cayenne.dba.oracle.OracleAdapter;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
@@ -53,8 +51,6 @@
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.map.DataMap;
 
-import com.mockrunner.mock.jdbc.MockDataSource;
-
 public class DataDomainProviderTest extends TestCase {
 
     public void testGet() {
@@ -109,14 +105,19 @@
                         new SkipSchemaUpdateStrategy());
                 binder.bind(DbAdapterFactory.class).toInstance(new DbAdapterFactory() {
 
-                    public DbAdapter createAdapter(DatabaseMetaData md)
-                            throws SQLException {
-                        throw new UnsupportedOperationException("TODO");
+                    public DbAdapter createAdapter(
+                            DataNodeDescriptor nodeDescriptor,
+                            DataSource dataSource) throws Exception {
+
+                        if (nodeDescriptor.getAdapterType() != null) {
+                            return (DbAdapter) Class.forName(
+                                    nodeDescriptor.getAdapterType()).newInstance();
+                        }
+
+                        return new MockDbAdapter();
                     }
                 });
 
-                binder.bind(DataSource.class).toInstance(new MockDataSource());
-                binder.bind(DbAdapter.class).to(AutoAdapter.class);
                 binder.bind(DataSourceFactoryLoader.class).toInstance(
                         new MockDataSourceFactoryLoader());
                 binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
@@ -183,6 +184,6 @@
                 .getName());
 
         assertNotNull(node2.getAdapter());
-        assertEquals(AutoAdapter.class, node2.getAdapter().getClass());
+        assertEquals(MockDbAdapter.class, node2.getAdapter().getClass());
     }
 }

Added: cayenne/main/trunk/itests/cayenne-di-stack/.classpath
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/.classpath?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/.classpath (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/.classpath Sun Dec  6 11:23:18 2009
@@ -0,0 +1,9 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;classpath&gt;
+	&lt;classpathentry kind="src" output="target/classes" path="src/main/java"/&gt;
+	&lt;classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/&gt;
+	&lt;classpathentry kind="src" output="target/test-classes" path="src/test/java"/&gt;
+	&lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/&gt;
+	&lt;classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/&gt;
+	&lt;classpathentry kind="output" path="target/classes"/&gt;
+&lt;/classpath&gt;

Added: cayenne/main/trunk/itests/cayenne-di-stack/.project
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/.project?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/.project (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/.project Sun Dec  6 11:23:18 2009
@@ -0,0 +1,23 @@
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;projectDescription&gt;
+	&lt;name&gt;cayenne-di-stack&lt;/name&gt;
+	&lt;comment&gt;&lt;/comment&gt;
+	&lt;projects&gt;
+	&lt;/projects&gt;
+	&lt;buildSpec&gt;
+		&lt;buildCommand&gt;
+			&lt;name&gt;org.eclipse.jdt.core.javabuilder&lt;/name&gt;
+			&lt;arguments&gt;
+			&lt;/arguments&gt;
+		&lt;/buildCommand&gt;
+		&lt;buildCommand&gt;
+			&lt;name&gt;org.maven.ide.eclipse.maven2Builder&lt;/name&gt;
+			&lt;arguments&gt;
+			&lt;/arguments&gt;
+		&lt;/buildCommand&gt;
+	&lt;/buildSpec&gt;
+	&lt;natures&gt;
+		&lt;nature&gt;org.eclipse.jdt.core.javanature&lt;/nature&gt;
+		&lt;nature&gt;org.maven.ide.eclipse.maven2Nature&lt;/nature&gt;
+	&lt;/natures&gt;
+&lt;/projectDescription&gt;

Added: cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.eclipse.jdt.core.prefs?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.eclipse.jdt.core.prefs (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.eclipse.jdt.core.prefs Sun Dec  6 11:23:18 2009
@@ -0,0 +1,5 @@
+#Sat Dec 05 19:10:26 EET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Added: cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.maven.ide.eclipse.prefs
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.maven.ide.eclipse.prefs?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.maven.ide.eclipse.prefs (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/.settings/org.maven.ide.eclipse.prefs Sun Dec  6 11:23:18 2009
@@ -0,0 +1,9 @@
+#Sat Dec 05 19:10:25 EET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Copied: cayenne/main/trunk/itests/cayenne-di-stack/pom.xml (from r887667, cayenne/main/trunk/itests/pom.xml)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/pom.xml?p2=cayenne/main/trunk/itests/cayenne-di-stack/pom.xml&amp;p1=cayenne/main/trunk/itests/pom.xml&amp;r1=887667&amp;r2=887668&amp;rev=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/itests/pom.xml (original)
+++ cayenne/main/trunk/itests/cayenne-di-stack/pom.xml Sun Dec  6 11:23:18 2009
@@ -17,42 +17,56 @@
 	specific language governing permissions and limitations
 	under the License.   
 --&gt;
+&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
+
+	&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+
+	&lt;parent&gt;
+		&lt;groupId&gt;org.apache.cayenne.itests&lt;/groupId&gt;
+		&lt;artifactId&gt;cayenne-itests-parent&lt;/artifactId&gt;
+		&lt;version&gt;3.1-SNAPSHOT&lt;/version&gt;
+	&lt;/parent&gt;
+
+	&lt;description&gt;Integration Tests - Cayenne DI Stack&lt;/description&gt;
+	&lt;artifactId&gt;cayenne-di-stack&lt;/artifactId&gt;
+	&lt;name&gt;Integration Tests - Cayenne DI Stack&lt;/name&gt;
+	&lt;packaging&gt;jar&lt;/packaging&gt;
+
+	&lt;dependencies&gt;
+		&lt;dependency&gt;
+			&lt;groupId&gt;junit&lt;/groupId&gt;
+			&lt;artifactId&gt;junit&lt;/artifactId&gt;
+			&lt;scope&gt;compile&lt;/scope&gt;
+		&lt;/dependency&gt;
+
+		&lt;dependency&gt;
+			&lt;groupId&gt;org.apache.cayenne.itests&lt;/groupId&gt;
+			&lt;artifactId&gt;itest-common&lt;/artifactId&gt;
+			&lt;version&gt;${version}&lt;/version&gt;
+		&lt;/dependency&gt;
+
+	&lt;/dependencies&gt;
 
-&lt;project
-    xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
-    
-    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
-
-    &lt;parent&gt;
-      &lt;groupId&gt;org.apache.cayenne&lt;/groupId&gt;
-      &lt;artifactId&gt;cayenne-parent&lt;/artifactId&gt;
-      &lt;version&gt;3.1-SNAPSHOT&lt;/version&gt;
-    &lt;/parent&gt;
-
-    &lt;groupId&gt;org.apache.cayenne.itests&lt;/groupId&gt;
-    &lt;artifactId&gt;cayenne-itests-parent&lt;/artifactId&gt;
-    &lt;name&gt;Cayenne Integration Tests Parent&lt;/name&gt;
-    &lt;packaging&gt;pom&lt;/packaging&gt;
-    
-    &lt;modules&gt;
-      &lt;module&gt;itest-common&lt;/module&gt;
-      &lt;module&gt;jpa-chapter2&lt;/module&gt;
-      &lt;module&gt;jpa-chapter3&lt;/module&gt;
-      &lt;module&gt;jpa-chapter5&lt;/module&gt;
-      &lt;module&gt;jpa-chapter6&lt;/module&gt;
-      &lt;module&gt;jpa-chapter9&lt;/module&gt;
-    &lt;/modules&gt;
 	&lt;build&gt;
 		&lt;plugins&gt;
 			&lt;plugin&gt;
+				&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
+				&lt;configuration&gt;
+					&lt;source&gt;1.5&lt;/source&gt;
+					&lt;target&gt;1.5&lt;/target&gt;
+				&lt;/configuration&gt;
+			&lt;/plugin&gt;
+			
+			&lt;plugin&gt;
 				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
 				&lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
 				&lt;configuration&gt;
 					&lt;skip&gt;true&lt;/skip&gt;
 				&lt;/configuration&gt;
 			&lt;/plugin&gt;
+
 		&lt;/plugins&gt;
 	&lt;/build&gt;
 &lt;/project&gt;

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/DefaultMap.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/DefaultMap.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/DefaultMap.java (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/DefaultMap.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,18 @@
+package org.apache.cayenne.itest.di_stack;
+
+import org.apache.cayenne.itest.di_stack.auto._DefaultMap;
+
+public class DefaultMap extends _DefaultMap {
+
+    private static DefaultMap instance;
+
+    private DefaultMap() {}
+
+    public static DefaultMap getInstance() {
+        if(instance == null) {
+            instance = new DefaultMap();
+        }
+
+        return instance;
+    }
+}

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/Table1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/Table1.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/Table1.java (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/Table1.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,7 @@
+package org.apache.cayenne.itest.di_stack;
+
+import org.apache.cayenne.itest.di_stack.auto._Table1;
+
+public class Table1 extends _Table1 {
+
+}

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_DefaultMap.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_DefaultMap.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_DefaultMap.java (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_DefaultMap.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,12 @@
+package org.apache.cayenne.itest.di_stack.auto;
+
+
+
+/**
+ * This class was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public class _DefaultMap {
+}
\ No newline at end of file

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_Table1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_Table1.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_Table1.java (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/itest/di_stack/auto/_Table1.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,24 @@
+package org.apache.cayenne.itest.di_stack.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+
+/**
+ * Class _Table1 was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public abstract class _Table1 extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setName(String name) {
+        writeProperty("name", name);
+    }
+    public String getName() {
+        return (String)readProperty("name");
+    }
+
+}

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntimeCase.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntimeCase.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntimeCase.java (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/CayenneServerRuntimeCase.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,69 @@
+package org.apache.cayenne.runtime;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy;
+import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
+import org.apache.cayenne.itest.ItestDBUtils;
+import org.apache.cayenne.itest.ItestTableUtils;
+
+public abstract class CayenneServerRuntimeCase extends TestCase {
+
+	static final Map&lt;RuntimeName, CayenneServerRuntime&gt; runtimeCache;
+
+	static {
+		runtimeCache = new HashMap&lt;RuntimeName, CayenneServerRuntime&gt;();
+	}
+
+	protected CayenneServerRuntime runtime;
+
+	@Override
+	protected void setUp() throws Exception {
+
+		RuntimeName name = getRuntimeName();
+		assertNotNull(name);
+
+		runtime = runtimeCache.get(name);
+		if (runtime == null) {
+			runtime = new CayenneServerRuntime(name.name());
+			runtimeCache.put(name, runtime);
+
+			// setup schema
+
+			// TODO: should that be drop/create?
+			SchemaUpdateStrategy dbCreator = new CreateIfNoSchemaStrategy();
+			dbCreator.updateSchema(getDataNode());
+		}
+	}
+
+	@Override
+	protected void tearDown() throws Exception {
+		runtime = null;
+	}
+
+	protected abstract RuntimeName getRuntimeName();
+
+	protected ItestDBUtils getDbUtils() {
+
+		return new ItestDBUtils(getDataNode().getDataSource());
+	}
+
+	protected ItestTableUtils getTableHelper(String tableName) {
+		return new ItestTableUtils(getDbUtils(), tableName);
+	}
+
+	private DataNode getDataNode() {
+		Collection&lt;DataNode&gt; nodes = runtime.getDataDomain().getDataNodes();
+		assertFalse("Can't find DataSource - no nodes configured", nodes
+				.isEmpty());
+		assertEquals("Can't find DataSource - multiple nodes found", 1, nodes
+				.size());
+
+		return nodes.iterator().next();
+	}
+}

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/RuntimeName.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/RuntimeName.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/RuntimeName.java (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/runtime/RuntimeName.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,6 @@
+package org.apache.cayenne.runtime;
+
+public enum RuntimeName {
+
+	DEFAULT
+}

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/DefaultMap.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/DefaultMap.map.xml?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/DefaultMap.map.xml (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/DefaultMap.map.xml Sun Dec  6 11:23:18 2009
@@ -0,0 +1,14 @@
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap http://cayenne.apache.org/schema/3.0/modelMap.xsd"
+  project-version="3.0.0.1"&gt;
+	&lt;property name="defaultPackage" value="org.apache.cayenne.itest.di_stack"/&gt;
+	&lt;db-entity name="TABLE1"&gt;
+		&lt;db-attribute name="ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/&gt;
+		&lt;db-attribute name="NAME" type="VARCHAR" length="255"/&gt;
+	&lt;/db-entity&gt;
+	&lt;obj-entity name="Table1" className="org.apache.cayenne.itest.di_stack.Table1" dbEntityName="TABLE1"&gt;
+		&lt;obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/&gt;
+	&lt;/obj-entity&gt;
+&lt;/data-map&gt;

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/PoolingDSNode.driver.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/PoolingDSNode.driver.xml?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/PoolingDSNode.driver.xml (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/PoolingDSNode.driver.xml Sun Dec  6 11:23:18 2009
@@ -0,0 +1,6 @@
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;driver project-version="3.0.0.1" class="org.hsqldb.jdbcDriver"&gt;
+	&lt;url value="jdbc:hsqldb:mem:DEFAULT"/&gt;
+	&lt;connectionPool min="1" max="1"/&gt;
+	&lt;login/&gt;
+&lt;/driver&gt;

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/cayenne-DEFAULT.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/cayenne-DEFAULT.xml?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/cayenne-DEFAULT.xml (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/cayenne-DEFAULT.xml Sun Dec  6 11:23:18 2009
@@ -0,0 +1,10 @@
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;domain name="DefaultDomain" project-version="3.0.0.1"&gt;
+	&lt;map name="DefaultMap" location="DefaultMap.map.xml"/&gt;
+
+	&lt;node name="PoolingDSNode"
+		 datasource="PoolingDSNode.driver.xml"
+		 factory="org.apache.cayenne.configuration.XMLPoolingDataSourceFactory"&gt;
+			&lt;map-ref name="DefaultMap"/&gt;
+	 &lt;/node&gt;
+&lt;/domain&gt;

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/log4j.properties?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/log4j.properties (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/resources/log4j.properties Sun Dec  6 11:23:18 2009
@@ -0,0 +1,6 @@
+log4j.rootLogger=WARN, A1
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=[%d{dd/MMM/yyyy:HH:mm:ss}] %t %x %-5p %c{1}: %m%n
+
+log4j.logger.org.apache.cayenne=DEBUG
\ No newline at end of file

Added: cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java?rev=887668&amp;view=auto
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java (added)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java Sun Dec  6 11:23:18 2009
@@ -0,0 +1,61 @@
+package org.apache.cayenne.runtime;
+
+import org.apache.cayenne.Cayenne;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.itest.ItestDBUtils;
+import org.apache.cayenne.itest.di_stack.Table1;
+import org.apache.cayenne.query.SelectQuery;
+
+public class CayenneServerRuntimeIntegrationTest extends
+		CayenneServerRuntimeCase {
+
+	@Override
+	protected RuntimeName getRuntimeName() {
+		return RuntimeName.DEFAULT;
+	}
+
+	public void testGetDomain_singleton() {
+
+		DataDomain domain1 = runtime.getDataDomain();
+		assertNotNull(domain1);
+
+		DataDomain domain2 = runtime.getDataDomain();
+		assertNotNull(domain2);
+
+		assertSame(domain1, domain2);
+	}
+
+	public void testNewContext_notSingleton() {
+
+		ObjectContext context1 = runtime.newContext();
+		assertNotNull(context1);
+
+		ObjectContext context2 = runtime.newContext();
+		assertNotNull(context2);
+
+		assertNotSame(context1, context2);
+	}
+
+	public void testNewContext_separateObjects() throws Exception {
+		ItestDBUtils dbUtils = getDbUtils();
+		dbUtils.deleteAll("TABLE1");
+		dbUtils.insert("TABLE1", new String[] { "ID", "NAME" }, new Object[] {
+				1, "Abc" });
+
+		SelectQuery query = new SelectQuery(Table1.class);
+
+		ObjectContext context1 = runtime.newContext();
+		ObjectContext context2 = runtime.newContext();
+
+		Table1 o1 = (Table1) Cayenne.objectForQuery(context1, query);
+		Table1 o2 = (Table1) Cayenne.objectForQuery(context2, query);
+
+		assertNotNull(o1);
+		assertNotNull(o2);
+		assertEquals("Abc", o1.getName());
+		assertNotSame(o1, o2);
+		assertEquals(o1.getObjectId(), o2.getObjectId());
+
+	}
+}

Modified: cayenne/main/trunk/itests/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/pom.xml?rev=887668&amp;r1=887667&amp;r2=887668&amp;view=diff
==============================================================================
--- cayenne/main/trunk/itests/pom.xml (original)
+++ cayenne/main/trunk/itests/pom.xml Sun Dec  6 11:23:18 2009
@@ -38,6 +38,7 @@
     
     &lt;modules&gt;
       &lt;module&gt;itest-common&lt;/module&gt;
+      &lt;module&gt;cayenne-di-stack&lt;/module&gt;
       &lt;module&gt;jpa-chapter2&lt;/module&gt;
       &lt;module&gt;jpa-chapter3&lt;/module&gt;
       &lt;module&gt;jpa-chapter5&lt;/module&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887667 [2/2] - in /cayenne/main/trunk/framework: cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/ cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/ cayenne-jdk1.5-unpublished/src/main/java/org/apac...</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091206112222.9862D23889E4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091206112222-9862D23889E4@eris-apache-org%3e</id>
<updated>2009-12-06T11:22:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoaderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoaderTest.java?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoaderTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoaderTest.java
Sun Dec  6 11:22:19 2009
@@ -0,0 +1,96 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.cayenne.configuration.mock.MockDataSourceFactory1;
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.resource.ResourceLocator;
+import org.apache.cayenne.resource.URLResource;
+import org.apache.cayenne.resource.mock.MockResourceLocator;
+
+public class DefaultDataSourceFactoryLoaderTest extends TestCase {
+
+    public void testGetDataSourceFactory_Implicit() throws Exception {
+        String baseUrl = getClass().getPackage().getName().replace('.', '/');
+        URL url = getClass().getClassLoader().getResource(
+                baseUrl + "/testNode1.driver.xml");
+        assertNotNull(url);
+
+        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
+        nodeDescriptor.setName("node1");
+        nodeDescriptor.setConfigurationResource(new URLResource(url));
+
+        Module testModule = new Module() {
+
+            public void configure(Binder binder) {
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+                binder.bind(ResourceLocator.class).to(MockResourceLocator.class);
+            }
+        };
+
+        Injector injector = DIBootstrap.createInjector(testModule);
+
+        DefaultDataSourceFactoryLoader factoryLoader = new DefaultDataSourceFactoryLoader();
+        injector.injectMembers(factoryLoader);
+
+        DataSourceFactory factory = factoryLoader.getDataSourceFactory(nodeDescriptor);
+        assertNotNull(factory);
+        assertTrue(factory instanceof XMLPoolingDataSourceFactory);
+    }
+
+    public void testGetDataSourceFactory_Explicit() throws Exception {
+        String baseUrl = getClass().getPackage().getName().replace('.', '/');
+        URL url = getClass().getClassLoader().getResource(
+                baseUrl + "/testNode1.driver.xml");
+        assertNotNull(url);
+
+        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
+        nodeDescriptor.setName("node1");
+        nodeDescriptor.setConfigurationResource(new URLResource(url));
+        nodeDescriptor.setDataSourceFactoryType(MockDataSourceFactory1.class.getName());
+
+        Module testModule = new Module() {
+
+            public void configure(Binder binder) {
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+                binder.bind(ResourceLocator.class).to(MockResourceLocator.class);
+            }
+        };
+
+        Injector injector = DIBootstrap.createInjector(testModule);
+
+        DefaultDataSourceFactoryLoader factoryLoader = new DefaultDataSourceFactoryLoader();
+        injector.injectMembers(factoryLoader);
+
+        DataSourceFactory factory = factoryLoader.getDataSourceFactory(nodeDescriptor);
+        assertNotNull(factory);
+        assertTrue(factory instanceof MockDataSourceFactory1);
+        assertSame(
+                "Injection on the factory hasn't been performed",
+                injector,
+                ((MockDataSourceFactory1) factory).getInjector());
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDbAdapterFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDbAdapterFactoryTest.java?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDbAdapterFactoryTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDbAdapterFactoryTest.java
Sun Dec  6 11:22:19 2009
@@ -0,0 +1,138 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.cayenne.dba.AutoAdapter;
+import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.MockDbAdapter;
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.map.DbEntity;
+
+import com.mockrunner.mock.jdbc.MockConnection;
+import com.mockrunner.mock.jdbc.MockDataSource;
+
+public class DefaultDbAdapterFactoryTest extends TestCase {
+
+    public void testCreatedAdapter_Auto() throws Exception {
+
+        final DbAdapter adapter = new MockDbAdapter() {
+
+            @Override
+            public String createTable(DbEntity ent) {
+                return "XXXXX";
+            }
+        };
+
+        List&lt;DbAdapterDetector&gt; detectors = new ArrayList&lt;DbAdapterDetector&gt;();
+        detectors.add(new DbAdapterDetector() {
+
+            public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
+                return adapter;
+            }
+        });
+
+        MockConnection connection = new MockConnection();
+
+        MockDataSource dataSource = new MockDataSource();
+        dataSource.setupConnection(connection);
+
+        Module testModule = new Module() {
+
+            public void configure(Binder binder) {
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+            }
+        };
+
+        Injector injector = DIBootstrap.createInjector(testModule);
+
+        DefaultDbAdapterFactory factory = new DefaultDbAdapterFactory(detectors);
+        injector.injectMembers(factory);
+
+        DbAdapter createdAdapter = factory.createAdapter(
+                new DataNodeDescriptor(),
+                dataSource);
+        assertTrue(createdAdapter instanceof AutoAdapter);
+        assertEquals("XXXXX", createdAdapter.createTable(new DbEntity("Test")));
+    }
+
+    public void testCreatedAdapter_Generic() throws Exception {
+
+        List&lt;DbAdapterDetector&gt; detectors = new ArrayList&lt;DbAdapterDetector&gt;();
+
+        Module testModule = new Module() {
+
+            public void configure(Binder binder) {
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+            }
+        };
+
+        Injector injector = DIBootstrap.createInjector(testModule);
+
+        DefaultDbAdapterFactory factory = new DefaultDbAdapterFactory(detectors);
+        injector.injectMembers(factory);
+
+        DbAdapter createdAdapter = factory.createAdapter(
+                new DataNodeDescriptor(),
+                new MockDataSource());
+        assertNotNull(createdAdapter);
+        assertTrue(
+                "Unexpected class: " + createdAdapter.getClass().getName(),
+                createdAdapter instanceof AutoAdapter);
+        assertEquals("CREATE TABLE Test ()", createdAdapter.createTable(new DbEntity(
+                "Test")));
+    }
+
+    public void testCreatedAdapter_Custom() throws Exception {
+
+        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
+        nodeDescriptor.setAdapterType(MockDbAdapter.class.getName());
+
+        List&lt;DbAdapterDetector&gt; detectors = new ArrayList&lt;DbAdapterDetector&gt;();
+
+        Module testModule = new Module() {
+
+            public void configure(Binder binder) {
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+            }
+        };
+
+        Injector injector = DIBootstrap.createInjector(testModule);
+
+        DefaultDbAdapterFactory factory = new DefaultDbAdapterFactory(detectors);
+        injector.injectMembers(factory);
+
+        DbAdapter createdAdapter = factory.createAdapter(
+                nodeDescriptor,
+                new MockDataSource());
+        assertNotNull(createdAdapter);
+        assertTrue(
+                "Unexpected class: " + createdAdapter.getClass().getName(),
+                createdAdapter instanceof MockDbAdapter);
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactoryTest.java?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactoryTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactoryTest.java
Sun Dec  6 11:22:19 2009
@@ -0,0 +1,66 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import java.net.URL;
+
+import javax.sql.DataSource;
+
+import junit.framework.TestCase;
+
+import org.apache.cayenne.conn.DataSourceInfo;
+import org.apache.cayenne.resource.URLResource;
+
+import com.mockrunner.mock.jdbc.MockDataSource;
+
+public class XMLPoolingDataSourceFactoryTest extends TestCase {
+
+    public void testGetDataSource() throws Exception {
+
+        String baseUrl = getClass().getPackage().getName().replace('.', '/');
+        URL url = getClass().getClassLoader().getResource(
+                baseUrl + "/testNode1.driver.xml");
+        assertNotNull(url);
+
+        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
+        nodeDescriptor.setConfigurationResource(new URLResource(url));
+
+        final DataSource dataSource = new MockDataSource();
+
+        XMLPoolingDataSourceFactory factory = new XMLPoolingDataSourceFactory() {
+
+            // override super to make test assertions and to prevent DB connection
+            @Override
+            protected DataSource createDataSource(DataSourceInfo dataSourceDescriptor)
+                    throws Exception {
+
+                assertEquals("jdbcDriver", dataSourceDescriptor.getJdbcDriver());
+                assertEquals("jdbcUrl", dataSourceDescriptor.getDataSourceUrl());
+                assertEquals(2, dataSourceDescriptor.getMinConnections());
+                assertEquals(3, dataSourceDescriptor.getMaxConnections());
+                assertEquals("jdbcUserName", dataSourceDescriptor.getUserName());
+                assertEquals("jdbcPassword", dataSourceDescriptor.getPassword());
+                return dataSource;
+            }
+        };
+
+        DataSource newDataSource = factory.getDataSource(nodeDescriptor);
+        assertSame(dataSource, newDataSource);
+    }
+}

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory.java
(from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory1.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory1.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory1.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory.java
Sun Dec  6 11:22:19 2009
@@ -16,15 +16,16 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
+package org.apache.cayenne.configuration.mock;
 
 import javax.sql.DataSource;
 
 import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.DataSourceFactory;
 
 import com.mockrunner.mock.jdbc.MockDataSource;
 
-public class MockDataSourceFactory1 implements DataSourceFactory {
+public class MockDataSourceFactory implements DataSourceFactory {
 
     public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) {
         return new MockDataSource();

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory1.java
(from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory1.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory1.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory1.java
Sun Dec  6 11:22:19 2009
@@ -16,18 +16,25 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
+package org.apache.cayenne.configuration.mock;
 
 import javax.sql.DataSource;
 
 import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.DataSourceFactory;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Injector;
 
-import com.mockrunner.mock.jdbc.MockDataSource;
+public class MockDataSourceFactory1 implements DataSourceFactory {
 
-public class MockDataSourceFactory2 implements DataSourceFactory {
+    @Inject
+    protected Injector injector;
 
-    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) {
-        return new MockDataSource();
+    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) throws Exception {
+        return null;
     }
 
+    public Injector getInjector() {
+        return injector;
+    }
 }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactoryLoader.java
(from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactoryLoader.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactoryLoader.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactoryLoader.java
Sun Dec  6 11:22:19 2009
@@ -16,18 +16,16 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
-
-import javax.sql.DataSource;
+package org.apache.cayenne.configuration.mock;
 
 import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.DataSourceFactory;
+import org.apache.cayenne.configuration.DataSourceFactoryLoader;
 
-import com.mockrunner.mock.jdbc.MockDataSource;
-
-public class MockDataSourceFactory2 implements DataSourceFactory {
+public class MockDataSourceFactoryLoader implements DataSourceFactoryLoader {
 
-    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) {
-        return new MockDataSource();
+    public DataSourceFactory getDataSourceFactory(DataNodeDescriptor nodeDescriptor) {
+        return new MockDataSourceFactory();
     }
 
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/MockDbAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/MockDbAdapter.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/MockDbAdapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/MockDbAdapter.java
Sun Dec  6 11:22:19 2009
@@ -19,13 +19,11 @@
 
 package org.apache.cayenne.dba;
 
-import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.Collection;
 
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.OperationObserver;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
@@ -33,7 +31,6 @@
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
 import org.apache.cayenne.merge.MergerFactory;
-import org.apache.cayenne.query.BatchQuery;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
 
@@ -69,10 +66,6 @@
         return false;
     }
 
-    public String dropTable(DbEntity ent) {
-        return null;
-    }
-
     public Collection&lt;String&gt; dropTableStatements(DbEntity table) {
         return null;
     }
@@ -127,28 +120,13 @@
         return null;
     }
 
-    public boolean shouldRunBatchQuery(
-            DataNode node,
-            Connection con,
-            BatchQuery query,
-            OperationObserver delegate) throws SQLException, Exception {
-        return false;
-    }
-
     public MergerFactory mergerFactory() {
         return null;
     }
 
     public void createTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column) {
     }
-    
-    public String getIdentifiersStartQuote(){
-        return "\"";
-    }
-    public String getIdentifiersEndQuote(){
-        return "\"";
-    }
-    
+
     public QuotingStrategy getQuotingStrategy(boolean isQuoteStrategy) {
         return null;
     }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/resource/mock/MockResourceLocator.java
(from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DriverDataSourceFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/resource/mock/MockResourceLocator.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/resource/mock/MockResourceLocator.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DriverDataSourceFactory.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DriverDataSourceFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/resource/mock/MockResourceLocator.java
Sun Dec  6 11:22:19 2009
@@ -16,19 +16,17 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
+package org.apache.cayenne.resource.mock;
 
-import javax.sql.DataSource;
+import java.util.Collection;
 
-import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.resource.Resource;
+import org.apache.cayenne.resource.ResourceLocator;
 
-/**
- * @since 3.1
- */
-public class DriverDataSourceFactory implements DataSourceFactory {
+public class MockResourceLocator implements ResourceLocator {
 
-    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) {
-        throw new UnsupportedOperationException("TODO");
+    public Collection&lt;Resource&gt; findResources(String name) {
+        return null;
     }
 
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java
Sun Dec  6 11:22:19 2009
@@ -33,11 +33,16 @@
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.ThrowOnPartialOrCreateSchemaStrategy;
+import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataChannelDescriptorLoader;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.DataSourceFactoryLoader;
+import org.apache.cayenne.configuration.DefaultAdhocObjectFactory;
 import org.apache.cayenne.configuration.DefaultRuntimeProperties;
 import org.apache.cayenne.configuration.RuntimeProperties;
+import org.apache.cayenne.configuration.mock.MockDataSourceFactory;
+import org.apache.cayenne.configuration.mock.MockDataSourceFactoryLoader;
 import org.apache.cayenne.dba.AutoAdapter;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
@@ -68,7 +73,7 @@
         nodeDescriptor1.setName("node1");
         nodeDescriptor1.getDataMapNames().add("map1");
         nodeDescriptor1.setAdapterType(OracleAdapter.class.getName());
-        nodeDescriptor1.setDataSourceFactoryType(MockDataSourceFactory1.class.getName());
+        nodeDescriptor1.setDataSourceFactoryType(MockDataSourceFactory.class.getName());
         nodeDescriptor1.setLocation("jdbc/testDataNode1");
         nodeDescriptor1
                 .setSchemaUpdateStrategyType(ThrowOnPartialOrCreateSchemaStrategy.class
@@ -112,8 +117,9 @@
 
                 binder.bind(DataSource.class).toInstance(new MockDataSource());
                 binder.bind(DbAdapter.class).to(AutoAdapter.class);
-                binder.bind(DataSourceFactory.class).toInstance(
-                        new MockDataSourceFactory2());
+                binder.bind(DataSourceFactoryLoader.class).toInstance(
+                        new MockDataSourceFactoryLoader());
+                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
             }
         };
 
@@ -165,8 +171,7 @@
         assertEquals(1, node2.getDataMaps().size());
         assertSame(map2, node2.getDataMaps().iterator().next());
         assertSame(node2, domain.lookupDataNode(map2));
-        assertEquals(MockDataSourceFactory2.class.getName(), node2
-                .getDataSourceFactory());
+        assertNull(node2.getDataSourceFactory());
         assertNotNull(node2.getDataSource());
         assertEquals(nodeDescriptor2.getLocation(), node2.getDataSourceLocation());
         assertEquals(SkipSchemaUpdateStrategy.class.getName(), node2

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testNode1.driver.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testNode1.driver.xml?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testNode1.driver.xml
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testNode1.driver.xml
Sun Dec  6 11:22:19 2009
@@ -0,0 +1,6 @@
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;driver project-version="6" class="jdbcDriver"&gt;
+	&lt;url value="jdbcUrl"/&gt;
+	&lt;connectionPool min="2" max="3"/&gt;
+	&lt;login userName="jdbcUserName" password="jdbcPassword"/&gt;
+&lt;/driver&gt;

Added: cayenne/main/trunk/framework/cayenne-server/pom.properties
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-server/pom.properties?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-server/pom.properties (added)
+++ cayenne/main/trunk/framework/cayenne-server/pom.properties Sun Dec  6 11:22:19 2009
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Sat Dec 05 14:56:16 CET 2009
+version=3.1-SNAPSHOT
+groupId=org.apache.cayenne
+artifactId=cayenne-server




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887667 [1/2] - in /cayenne/main/trunk/framework: cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/ cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/ cayenne-jdk1.5-unpublished/src/main/java/org/apac...</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091206112222.93B8723889D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091206112222-93B8723889D0@eris-apache-org%3e</id>
<updated>2009-12-06T11:22:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: aadamchik
Date: Sun Dec  6 11:22:19 2009
New Revision: 887667

URL: http://svn.apache.org/viewvc?rev=887667&amp;view=rev
Log:
CAY-1319 Switch Cayenne configuration loading to cayenne-di container

* configuration.DataSourceFactoryLoader
* configuration.DataSourceFactory
* configuration.XMLPoolingDataSourceFactory
* configuration.DbAdapterFactory
* configuration.AdhocObjectFactory

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/AdhocObjectFactory.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactory.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactoryLoader.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterDetector.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterFactory.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultAdhocObjectFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoader.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDbAdapterFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoaderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/DefaultDbAdapterFactoryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactoryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory1.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactory1.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/mock/MockDataSourceFactoryLoader.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/resource/mock/
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/resource/mock/MockResourceLocator.java
      - copied, changed from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DriverDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/org/apache/cayenne/configuration/testNode1.driver.xml
    cayenne/main/trunk/framework/cayenne-server/pom.properties
Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DriverDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/JNDIDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory1.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/MockDataSourceFactory2.java
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/MockDbAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/runtime/DataDomainProviderTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DataSourceFactory.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DataSourceFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DataSourceFactory.java Sun Dec  6 11:22:19 2009
@@ -22,19 +22,22 @@
 import javax.sql.DataSource;
 
 /**
- * A pluggable factory for javax.sql.DataSource instances used by Cayenne runtime.
+ * A pluggable factory for {@link DataSource} instances used by Cayenne runtime.
+ * 
+ * @deprecated since 3.1, replaced by
+ *             {@link org.apache.cayenne.configuration.DataSourceFactory}
  */
 public interface DataSourceFactory {
 
     /**
      * Initializes factory with the parent configuration object.
      */
-    public void initializeWithParentConfiguration(Configuration conf);
+    void initializeWithParentConfiguration(Configuration conf);
 
     /**
      * Returns DataSource object corresponding to &lt;code&gt;location&lt;/code&gt;. Concrete
      * implementations may treat location differently - as a file path, JNDI location,
      * etc.
      */
-    public DataSource getDataSource(String location) throws Exception;
+    DataSource getDataSource(String location) throws Exception;
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java Sun Dec  6 11:22:19 2009
@@ -33,6 +33,7 @@
 import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.conn.PoolManager;
+import org.apache.cayenne.resource.ResourceLocator;
 import org.apache.cayenne.util.Util;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -47,17 +48,19 @@
  * Creates DataSource objects from XML configuration files that describe a JDBC driver.
  * Wraps JDBC driver in a generic DataSource implementation.
  * 
+ * @deprecated since 3.1 {@link org.apache.cayenne.configuration.XMLPoolingDataSourceFactory}
+ *             replaces this class.
  */
-// TODO: factory shouldn't contain any state specific to location ("driverInfo" ivar
-// should go, and probably "parser" too)... Otherwise the API doesn't make sense -
-// sequential invocations of getDataSource() will have side effects....
 public class DriverDataSourceFactory implements DataSourceFactory {
 
     private static final Log logger = LogFactory.getLog(DriverDataSourceFactory.class);
 
+    protected Configuration parentConfiguration;
+
+    // TODO: andrus 12.5.2009: non-thread-safe local ivars... SInce this class is
+    // deprecated, I guess we don't have to fix it here...
     protected XMLReader parser;
     protected DataSourceInfo driverInfo;
-    protected Configuration parentConfiguration;
 
     /**
      * Creates new DriverDataSourceFactory.
@@ -74,7 +77,7 @@
     }
 
     public DataSource getDataSource(String location) throws Exception {
-        this.load(location);
+        load(location);
 
         ConnectionLogger logger = new ConnectionLogger();
 
@@ -114,12 +117,11 @@
     }
 
     /**
-     * Loads driver information from the file at &lt;code&gt;location&lt;/code&gt;. Called
-     * internally from "getDataSource"
+     * Loads driver information from the file at &lt;code&gt;location&lt;/code&gt;. Called internally
+     * from "getDataSource"
+     * 
+     * @deprecated since 3.1
      */
-    // TODO: andrus 2008/04/22, while this never caused any troubles, storing loaded
-    // DataSourceInfo in an ivar clearly violates the scope logic, as "location" is a
-    // local variable.
     protected void load(String location) throws Exception {
         logger.info("loading driver information from '" + location + "'.");
 
@@ -236,6 +238,7 @@
     }
 
     private class LoginHandler extends AbstractHandler {
+
         /**
          * Constructor which just delegates to the superconstructor.
          * 
@@ -312,10 +315,10 @@
             String password = atts.getValue("password");
             String passwordLocation = atts.getValue("passwordLocation");
             String passwordSource = atts.getValue("passwordSource");
-            if(passwordSource == null) {
+            if (passwordSource == null) {
                 passwordSource = DataSourceInfo.PASSWORD_LOCATION_MODEL;
             }
-            
+
             String username = atts.getValue("userName");
 
             driverInfo.setPasswordEncoderClass(encoderClass);

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/AdhocObjectFactory.java (from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/AdhocObjectFactory.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/AdhocObjectFactory.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/AdhocObjectFactory.java Sun Dec  6 11:22:19 2009
@@ -16,21 +16,18 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
-
-import javax.sql.DataSource;
-
-import org.apache.cayenne.configuration.DataNodeDescriptor;
+package org.apache.cayenne.configuration;
 
 /**
- * Provides instances of {@link DataSource} for DataNodes.
+ * Creates objects for user-provided String class names, injecting dependencies into them.
  * 
  * @since 3.1
  */
-public interface DataSourceFactory {
+public interface AdhocObjectFactory {
 
     /**
-     * Returns a DataSource for a given {@link DataNodeDescriptor} configuration object.
+     * Returns an instance of "className" that implements "superType", injecting
+     * dependencies from the registry into it.
      */
-    DataSource getDataSource(DataNodeDescriptor nodeDescriptor);
+    &lt;T&gt; T newInstance(Class&lt;? super T&gt; superType, String className);
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/CayenneModule.java Sun Dec  6 11:22:19 2009
@@ -21,8 +21,20 @@
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
-import org.apache.cayenne.dba.AutoAdapter;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.db2.DB2Sniffer;
+import org.apache.cayenne.dba.derby.DerbySniffer;
+import org.apache.cayenne.dba.frontbase.FrontBaseSniffer;
+import org.apache.cayenne.dba.h2.H2Sniffer;
+import org.apache.cayenne.dba.hsqldb.HSQLDBSniffer;
+import org.apache.cayenne.dba.ingres.IngresSniffer;
+import org.apache.cayenne.dba.mysql.MySQLSniffer;
+import org.apache.cayenne.dba.openbase.OpenBaseSniffer;
+import org.apache.cayenne.dba.oracle.OracleSniffer;
+import org.apache.cayenne.dba.postgres.PostgresSniffer;
+import org.apache.cayenne.dba.sqlite.SQLiteSniffer;
+import org.apache.cayenne.dba.sqlserver.SQLServerSniffer;
+import org.apache.cayenne.dba.sybase.SybaseSniffer;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.di.Scopes;
@@ -30,8 +42,6 @@
 import org.apache.cayenne.resource.ResourceLocator;
 import org.apache.cayenne.runtime.CayenneRuntime;
 import org.apache.cayenne.runtime.DataDomainProvider;
-import org.apache.cayenne.runtime.DataSourceFactory;
-import org.apache.cayenne.runtime.DriverDataSourceFactory;
 
 /**
  * A DI module containing all Cayenne runtime configurations. To customize Cayenne runtime
@@ -55,6 +65,27 @@
                 RuntimeProperties.CAYENNE_RUNTIME_NAME,
                 runtimeName);
 
+        // configure known DbAdapter detectors in reverse order of popularity. Users can
+        // add their own for their own to install custom adapters automatically
+        binder
+                .bindList(DbAdapter.class)
+                .add(new OpenBaseSniffer())
+                .add(new FrontBaseSniffer())
+                .add(new IngresSniffer())
+                .add(new SQLiteSniffer())
+                .add(new DB2Sniffer())
+                .add(new H2Sniffer())
+                .add(new HSQLDBSniffer())
+                .add(new SybaseSniffer())
+                .add(new DerbySniffer())
+                .add(new SQLServerSniffer())
+                .add(new OracleSniffer())
+                .add(new PostgresSniffer())
+                .add(new MySQLSniffer());
+
+        binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class).in(
+                Scopes.SINGLETON);
+
         // a service to provide the main stack DataChannel
         binder.bind(DataChannel.class).toProvider(DataDomainProvider.class);
 
@@ -73,16 +104,16 @@
         binder.bind(RuntimeProperties.class).to(DefaultRuntimeProperties.class).in(
                 Scopes.SINGLETON);
 
+        // a service to load DataSourceFactories
+        binder.bind(DataSourceFactoryLoader.class).to(
+                DefaultDataSourceFactoryLoader.class).in(Scopes.SINGLETON);
+
         // a default SchemaUpdateStrategy (used when no explicit strategy is specified in
         // XML)
-        binder.bind(SchemaUpdateStrategy.class).to(SkipSchemaUpdateStrategy.class);
-
-        // a default DBAdapter (used when no explicit adapter is set in XML)
-
-        // TODO: andrus 11.30.2009: missing dependencies: DataSource, DbAdapterFactory
-        binder.bind(DbAdapter.class).to(AutoAdapter.class);
+        binder.bind(SchemaUpdateStrategy.class).to(SkipSchemaUpdateStrategy.class).in(
+                Scopes.SINGLETON);
 
-        // a service to find or create DataSources
-        binder.bind(DataSourceFactory.class).to(DriverDataSourceFactory.class);
+        // a default DBAdapterFactory used to load custom and automatic DbAdapters
+        binder.bind(DbAdapterFactory.class).to(DefaultDbAdapterFactory.class);
     }
 }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactory.java (from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactory.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactory.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactory.java Sun Dec  6 11:22:19 2009
@@ -16,21 +16,18 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
+package org.apache.cayenne.configuration;
 
 import javax.sql.DataSource;
 
-import org.apache.cayenne.configuration.DataNodeDescriptor;
-
 /**
- * Provides instances of {@link DataSource} for DataNodes.
- * 
  * @since 3.1
  */
 public interface DataSourceFactory {
 
     /**
-     * Returns a DataSource for a given {@link DataNodeDescriptor} configuration object.
+     * Returns DataSource object based on the configuration provided in the
+     * "nodeDescriptor".
      */
-    DataSource getDataSource(DataNodeDescriptor nodeDescriptor);
+    DataSource getDataSource(DataNodeDescriptor nodeDescriptor) throws Exception;
 }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactoryLoader.java (from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactoryLoader.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactoryLoader.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DataSourceFactoryLoader.java Sun Dec  6 11:22:19 2009
@@ -16,21 +16,19 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
-
-import javax.sql.DataSource;
-
-import org.apache.cayenne.configuration.DataNodeDescriptor;
+package org.apache.cayenne.configuration;
 
 /**
- * Provides instances of {@link DataSource} for DataNodes.
+ * Provides instances of {@link DataSourceFactory} for DataNodes.
  * 
  * @since 3.1
  */
-public interface DataSourceFactory {
+public interface DataSourceFactoryLoader {
 
     /**
-     * Returns a DataSource for a given {@link DataNodeDescriptor} configuration object.
+     * Returns a DataSourceFactory for a given {@link DataNodeDescriptor} configuration
+     * object. The factory should be specified in the node descriptor explicitly by the
+     * user. Cayenne will inject dependencies in all user-provided factories.
      */
-    DataSource getDataSource(DataNodeDescriptor nodeDescriptor);
+    DataSourceFactory getDataSourceFactory(DataNodeDescriptor nodeDescriptor);
 }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterDetector.java (from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterDetector.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterDetector.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterDetector.java Sun Dec  6 11:22:19 2009
@@ -16,25 +16,26 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-
-package org.apache.cayenne.dba;
+package org.apache.cayenne.configuration;
 
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.dba.DbAdapter;
+
 /**
- * Defines a conditional factory for a specific DbAdapter. Note that the factory can
- * potentially return different (or differently configured) DbAdapters for the same
- * database based on version information and other metadata.
+ * A factory interface providing DbAdapter based on JDBC metadata. It allows custom
+ * DbAdapters to contribute database detection algorithms to
+ * {@link DefaultDbAdapterFactory}.
  * 
- * @since 1.2
+ * @since 3.1
  */
-public interface DbAdapterFactory {
+public interface DbAdapterDetector {
 
     /**
      * Returns an instance of DbAdapter if the factory detects that it knows how to handle
-     * the database. Returns null if the database is not known to the factory, thus
-     * allowing multiple factories to be chained.
+     * the database or null if the database is not known to the factory, thus allowing
+     * multiple factories to be chained.
      */
     DbAdapter createAdapter(DatabaseMetaData md) throws SQLException;
 }

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterFactory.java (from r887666, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterFactory.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterFactory.java&amp;p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java&amp;r1=887666&amp;r2=887667&amp;rev=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataSourceFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DbAdapterFactory.java Sun Dec  6 11:22:19 2009
@@ -16,21 +16,21 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
+package org.apache.cayenne.configuration;
 
 import javax.sql.DataSource;
 
-import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.dba.DbAdapter;
 
 /**
- * Provides instances of {@link DataSource} for DataNodes.
- * 
  * @since 3.1
  */
-public interface DataSourceFactory {
+public interface DbAdapterFactory {
 
     /**
-     * Returns a DataSource for a given {@link DataNodeDescriptor} configuration object.
+     * Returns an instance of DbAdapter if the factory detects that it knows how to handle
+     * the database.
      */
-    DataSource getDataSource(DataNodeDescriptor nodeDescriptor);
+    DbAdapter createAdapter(DataNodeDescriptor nodeDescriptor, DataSource dataSource)
+            throws Exception;
 }

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultAdhocObjectFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultAdhocObjectFactory.java?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultAdhocObjectFactory.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultAdhocObjectFactory.java Sun Dec  6 11:22:19 2009
@@ -0,0 +1,83 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.util.Util;
+
+/**
+ * A default implementation of {@link AdhocObjectFactory} that creates objects using
+ * default no-arg constructor and injects dependencies into annotated fields. Note that
+ * constructor injection is not supported by this factory.
+ * 
+ * @since 3.1
+ */
+public class DefaultAdhocObjectFactory implements AdhocObjectFactory {
+
+    @Inject
+    protected Injector injector;
+
+    public &lt;T&gt; T newInstance(Class&lt;? super T&gt; superType, String className) {
+
+        if (superType == null) {
+            throw new NullPointerException("Null superType");
+        }
+
+        if (className == null) {
+            throw new NullPointerException("Null className");
+        }
+
+        Class&lt;T&gt; type;
+        try {
+            type = (Class&lt;T&gt;) Util.getJavaClass(className);
+        }
+        catch (ClassNotFoundException e) {
+            throw new CayenneRuntimeException(
+                    "Invalid class %s of type %s",
+                    e,
+                    className,
+                    superType.getName());
+        }
+
+        if (!superType.isAssignableFrom(type)) {
+            throw new CayenneRuntimeException(
+                    "Class %s is not assignable to %s",
+                    className,
+                    superType.getName());
+        }
+
+        T instance;
+        try {
+            instance = type.newInstance();
+        }
+        catch (Exception e) {
+            throw new CayenneRuntimeException(
+                    "Error creating instance of class %s of type %s",
+                    e,
+                    className,
+                    superType.getName());
+        }
+
+        injector.injectMembers(instance);
+        return instance;
+    }
+
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoader.java?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoader.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDataSourceFactoryLoader.java Sun Dec  6 11:22:19 2009
@@ -0,0 +1,55 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.di.Inject;
+
+/**
+ * A {@link DataSourceFactoryLoader} that loads factories explicitly configured in the
+ * {@link DataNodeDescriptor}. If the factory class is not explicitly configured, and the
+ * descriptor has a configuration resource attached to it, {@link XMLPoolingDataSourceFactory}
+ * is returned.
+ * 
+ * @since 3.1
+ */
+public class DefaultDataSourceFactoryLoader implements DataSourceFactoryLoader {
+
+    @Inject
+    protected AdhocObjectFactory objectFactory;
+
+    public DataSourceFactory getDataSourceFactory(DataNodeDescriptor nodeDescriptor) {
+        String typeName = nodeDescriptor.getDataSourceFactoryType();
+
+        if (typeName == null) {
+            if (nodeDescriptor.getConfigurationResource() != null) {
+                return objectFactory.newInstance(
+                        DataSourceFactory.class,
+                        XMLPoolingDataSourceFactory.class.getName());
+            }
+            else {
+                throw new CayenneRuntimeException(
+                        "DataNodeDescriptor '%s' has no explicit DataSourceFactoryType set and has no configuration resource",
+                        nodeDescriptor.getName());
+            }
+        }
+
+        return objectFactory.newInstance(DataSourceFactory.class, typeName);
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDbAdapterFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDbAdapterFactory.java?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDbAdapterFactory.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultDbAdapterFactory.java Sun Dec  6 11:22:19 2009
@@ -0,0 +1,125 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.List;
+
+import javax.sql.DataSource;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.access.QueryLogger;
+import org.apache.cayenne.dba.AutoAdapter;
+import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.DIException;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Provider;
+
+/**
+ * A factory of DbAdapters that either loads user-provided adapter or guesses the adapter
+ * type from the database metadata.
+ * 
+ * @since 3.1
+ */
+public class DefaultDbAdapterFactory implements DbAdapterFactory {
+
+    @Inject
+    protected AdhocObjectFactory objectFactory;
+    protected List&lt;DbAdapterDetector&gt; detectors;
+
+    public DefaultDbAdapterFactory(@Inject List&lt;DbAdapterDetector&gt; detectors) {
+        if (detectors == null) {
+            throw new NullPointerException("Null detectors list");
+        }
+
+        this.detectors = detectors;
+    }
+
+    public DbAdapter createAdapter(
+            final DataNodeDescriptor nodeDescriptor,
+            final DataSource dataSource) throws Exception {
+
+        String adapterType = nodeDescriptor.getAdapterType();
+        if (adapterType != null) {
+            return objectFactory.newInstance(DbAdapter.class, adapterType);
+        }
+        else {
+            return new AutoAdapter(new Provider&lt;DbAdapter&gt;() {
+
+                public DbAdapter get() throws DIException {
+                    return detectAdapter(nodeDescriptor, dataSource);
+                }
+            });
+        }
+    }
+
+    protected DbAdapter detectAdapter(
+            DataNodeDescriptor nodeDescriptor,
+            DataSource dataSource) {
+
+        if (detectors.isEmpty()) {
+            return defaultAdapter();
+        }
+
+        try {
+            Connection c = dataSource.getConnection();
+
+            try {
+                return detectAdapter(c.getMetaData());
+            }
+            finally {
+                try {
+                    c.close();
+                }
+                catch (SQLException e) {
+                    // ignore...
+                }
+            }
+        }
+        catch (SQLException e) {
+            throw new CayenneRuntimeException("Error detecting database type: "
+                    + e.getLocalizedMessage(), e);
+        }
+    }
+
+    protected DbAdapter detectAdapter(DatabaseMetaData metaData) throws SQLException {
+        // iterate in reverse order to allow custom factories to take precedence over the
+        // default ones configured in constructor
+        for (int i = detectors.size() - 1; i &gt;= 0; i--) {
+            DbAdapterDetector detector = detectors.get(i);
+            DbAdapter adapter = detector.createAdapter(metaData);
+
+            if (adapter != null) {
+                QueryLogger.log("Detected and installed adapter: "
+                        + adapter.getClass().getName());
+                return adapter;
+            }
+        }
+
+        return defaultAdapter();
+    }
+
+    protected DbAdapter defaultAdapter() {
+        QueryLogger.log("Failed to detect database type, using generic adapter");
+        return new JdbcAdapter();
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactory.java?rev=887667&amp;view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactory.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/XMLPoolingDataSourceFactory.java Sun Dec  6 11:22:19 2009
@@ -0,0 +1,324 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.configuration;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+
+import javax.sql.DataSource;
+
+import org.apache.cayenne.ConfigurationException;
+import org.apache.cayenne.access.ConnectionLogger;
+import org.apache.cayenne.access.QueryLogger;
+import org.apache.cayenne.conf.PasswordEncoding;
+import org.apache.cayenne.conn.DataSourceInfo;
+import org.apache.cayenne.conn.PoolManager;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.resource.Resource;
+import org.apache.cayenne.resource.ResourceLocator;
+import org.apache.cayenne.util.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+
+/**
+ * A {@link DataSourceFactory} that loads JDBC connection information from an XML resource
+ * associated with the DataNodeDescriptor, returning a DataSource with simple connection
+ * pooling.
+ * 
+ * @since 3.1
+ */
+public class XMLPoolingDataSourceFactory implements DataSourceFactory {
+
+    private static final Log logger = LogFactory
+            .getLog(XMLPoolingDataSourceFactory.class);
+
+    @Inject
+    protected ResourceLocator resourceLocator;
+
+    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) throws Exception {
+
+        logger.info("loading driver information from '"
+                + nodeDescriptor.getLocation()
+                + "'.");
+
+        Resource resource = nodeDescriptor.getConfigurationResource();
+
+        if (resource == null) {
+            logger.info("Null configuration resource for node descriptor with location '"
+                    + nodeDescriptor.getLocation()
+                    + "'");
+            throw new ConfigurationException(
+                    "Null configuration resource for node descriptor with location '%s'",
+                    nodeDescriptor.getLocation());
+        }
+
+        DataSourceInfo dataSourceDescriptor = new DataSourceInfo();
+
+        XMLReader parser = Util.createXmlReader();
+
+        DriverHandler handler = new DriverHandler(dataSourceDescriptor, parser);
+        parser.setContentHandler(handler);
+        parser.setErrorHandler(handler);
+        parser.parse(new InputSource(resource.getURL().openStream()));
+
+        return createDataSource(dataSourceDescriptor);
+    }
+
+    /**
+     * Returns an instance of {@link PoolManager}.
+     */
+    protected DataSource createDataSource(DataSourceInfo dataSourceDescriptor)
+            throws Exception {
+
+        ConnectionLogger logger = new ConnectionLogger();
+        try {
+            return new PoolManager(
+                    dataSourceDescriptor.getJdbcDriver(),
+                    dataSourceDescriptor.getDataSourceUrl(),
+                    dataSourceDescriptor.getMinConnections(),
+                    dataSourceDescriptor.getMaxConnections(),
+                    dataSourceDescriptor.getUserName(),
+                    dataSourceDescriptor.getPassword(),
+                    logger);
+        }
+        catch (Exception e) {
+            QueryLogger.logConnectFailure(e);
+            throw e;
+        }
+    }
+
+    private static String passwordFromURL(URL url) {
+        InputStream inputStream = null;
+        String password = null;
+
+        try {
+            inputStream = url.openStream();
+            password = passwordFromInputStream(inputStream);
+        }
+        catch (IOException exception) {
+            // Log the error while trying to open the stream. A null
+            // password will be returned as a result.
+            logger.warn(exception);
+        }
+
+        return password;
+    }
+
+    private static String passwordFromInputStream(InputStream inputStream) {
+        BufferedReader bufferedReader = null;
+        String password = null;
+
+        try {
+            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+            password = bufferedReader.readLine();
+        }
+        catch (IOException exception) {
+            logger.warn(exception);
+        }
+        finally {
+            try {
+                if (bufferedReader != null) {
+                    bufferedReader.close();
+                }
+            }
+            catch (Exception exception) {
+            }
+
+            try {
+                inputStream.close();
+            }
+            catch (IOException exception) {
+            }
+        }
+
+        return password;
+    }
+
+    private class DriverHandler extends SAXNestedTagHandler {
+
+        private DataSourceInfo dataSourceDescriptor;
+
+        DriverHandler(DataSourceInfo dataSourceDescriptor, XMLReader parser) {
+            super(parser, null);
+            this.dataSourceDescriptor = dataSourceDescriptor;
+        }
+
+        @Override
+        protected ContentHandler createChildTagHandler(
+                String namespaceURI,
+                String localName,
+                String name,
+                Attributes attributes) {
+
+            if (localName.equals("driver")) {
+                String className = attributes.getValue("", "class");
+                logger.info("loading driver " + className);
+                dataSourceDescriptor.setJdbcDriver(className);
+                return new DriverChildrenHandler(parser, this);
+            }
+
+            return super.createChildTagHandler(namespaceURI, localName, name, attributes);
+        }
+    }
+
+    private class DriverChildrenHandler extends SAXNestedTagHandler {
+
+        private DataSourceInfo dataSourceDescriptor;
+
+        DriverChildrenHandler(XMLReader parser, DriverHandler parentHandler) {
+            super(parser, parentHandler);
+            this.dataSourceDescriptor = parentHandler.dataSourceDescriptor;
+        }
+
+        @Override
+        protected ContentHandler createChildTagHandler(
+                String namespaceURI,
+                String localName,
+                String name,
+                Attributes attributes) {
+
+            if (localName.equals("login")) {
+
+                logger.info("loading user name and password.");
+
+                String encoderClass = attributes.getValue("encoderClass");
+
+                String encoderKey = attributes.getValue("encoderKey");
+                if (encoderKey == null) {
+                    encoderKey = attributes.getValue("encoderSalt");
+                }
+
+                String password = attributes.getValue("password");
+                String passwordLocation = attributes.getValue("passwordLocation");
+                String passwordSource = attributes.getValue("passwordSource");
+                if (passwordSource == null) {
+                    passwordSource = DataSourceInfo.PASSWORD_LOCATION_MODEL;
+                }
+
+                String username = attributes.getValue("userName");
+
+                dataSourceDescriptor.setPasswordEncoderClass(encoderClass);
+                dataSourceDescriptor.setPasswordEncoderKey(encoderKey);
+                dataSourceDescriptor.setPasswordLocation(passwordLocation);
+                dataSourceDescriptor.setPasswordSource(passwordSource);
+                dataSourceDescriptor.setUserName(username);
+
+                // Replace {} in passwordSource with encoderSalt -- useful for EXECUTABLE
+                // &amp; URL options
+                if (encoderKey != null) {
+                    passwordSource = passwordSource.replaceAll("\\{\\}", encoderKey);
+                }
+
+                PasswordEncoding passwordEncoder = dataSourceDescriptor
+                        .getPasswordEncoder();
+
+                if (passwordLocation != null) {
+                    if (passwordLocation
+                            .equals(DataSourceInfo.PASSWORD_LOCATION_CLASSPATH)) {
+                        Collection&lt;Resource&gt; urls = resourceLocator
+                                .findResources(passwordLocation);
+                        if (urls.size() &gt; 0) {
+                            password = passwordFromURL(urls.iterator().next().getURL());
+                        }
+                        else {
+                            logger.error("Could not find resource in CLASSPATH: "
+                                    + passwordSource);
+                        }
+                    }
+                    else if (passwordLocation
+                            .equals(DataSourceInfo.PASSWORD_LOCATION_URL)) {
+                        try {
+                            password = passwordFromURL(new URL(passwordSource));
+                        }
+                        catch (MalformedURLException exception) {
+                            logger.warn(exception);
+                        }
+                    }
+                    else if (passwordLocation
+                            .equals(DataSourceInfo.PASSWORD_LOCATION_EXECUTABLE)) {
+                        if (passwordSource != null) {
+                            try {
+                                Process process = Runtime.getRuntime().exec(
+                                        passwordSource);
+                                password = passwordFromInputStream(process
+                                        .getInputStream());
+                                process.waitFor();
+                            }
+                            catch (IOException exception) {
+                                logger.warn(exception);
+                            }
+                            catch (InterruptedException exception) {
+                                logger.warn(exception);
+                            }
+                        }
+                    }
+                }
+
+                if (password != null &amp;&amp; passwordEncoder != null) {
+                    dataSourceDescriptor.setPassword(passwordEncoder.decodePassword(
+                            password,
+                            encoderKey));
+                }
+            }
+            else if (localName.equals("url")) {
+                dataSourceDescriptor.setDataSourceUrl(attributes.getValue("value"));
+            }
+            else if (localName.equals("connectionPool")) {
+                String min = attributes.getValue("min");
+                if (min != null) {
+                    try {
+                        dataSourceDescriptor.setMinConnections(Integer.parseInt(min));
+                    }
+                    catch (NumberFormatException nfex) {
+                        logger.info("Non-numeric 'min' attribute", nfex);
+                        throw new ConfigurationException(
+                                "Non-numeric 'min' attribute '%s'",
+                                nfex,
+                                min);
+                    }
+                }
+
+                String max = attributes.getValue("max");
+                if (max != null) {
+                    try {
+                        dataSourceDescriptor.setMaxConnections(Integer.parseInt(max));
+                    }
+                    catch (NumberFormatException nfex) {
+                        logger.info("Non-numeric 'max' attribute", nfex);
+                        throw new ConfigurationException(
+                                "Non-numeric 'max' attribute '%s'",
+                                nfex,
+                                max);
+                    }
+                }
+            }
+
+            return super.createChildTagHandler(namespaceURI, localName, name, attributes);
+        }
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java Sun Dec  6 11:22:19 2009
@@ -48,7 +48,8 @@
 import org.apache.cayenne.dba.sqlite.SQLiteSniffer;
 import org.apache.cayenne.dba.sqlserver.SQLServerSniffer;
 import org.apache.cayenne.dba.sybase.SybaseSniffer;
-import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.DIException;
+import org.apache.cayenne.di.Provider;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
@@ -68,8 +69,15 @@
     final static String DEFAULT_QUOTE_SQL_IDENTIFIERS_CHAR_START = "\"";
     final static String DEFAULT_QUOTE_SQL_IDENTIFIERS_CHAR_END = "\"";
 
+    /**
+     * @deprecated since 3.1 in favor of
+     *             {@link org.apache.cayenne.configuration.DbAdapterFactory} configured
+     *             via dependency injection.
+     */
     static final List&lt;DbAdapterFactory&gt; defaultFactories;
+
     static {
+
         defaultFactories = new ArrayList&lt;DbAdapterFactory&gt;();
 
         // hardcoded factories for adapters that we know how to auto-detect
@@ -93,6 +101,9 @@
      * Allows application code to add a sniffer to detect a custom adapter.
      * 
      * @since 3.0
+     * @deprecated since 3.1 in favor of
+     *             {@link org.apache.cayenne.configuration.DbAdapterFactory} configured
+     *             via dependency injection.
      */
     public static void addFactory(DbAdapterFactory factory) {
         defaultFactories.add(factory);
@@ -101,47 +112,114 @@
     /**
      * Returns a DbAdapterFactory configured to detect all databases officially supported
      * by Cayenne.
+     * 
+     * @deprecated since 3.1 in favor of
+     *             {@link org.apache.cayenne.configuration.DbAdapterFactory} configured
+     *             via dependency injection.
      */
     public static DbAdapterFactory getDefaultFactory() {
         return new DbAdapterFactoryChain(defaultFactories);
     }
 
-    protected DbAdapterFactory adapterFactory;
-    protected DataSource dataSource;
+    protected Provider&lt;DbAdapter&gt; adapterProvider;
     protected PkGenerator pkGenerator;
 
     /**
-     * The actual adapter that is delegated method execution.
+     * The actual adapter that is delegated methods execution.
      */
-    DbAdapter adapter;
+    volatile DbAdapter adapter;
 
     /**
      * Creates an AutoAdapter that can detect adapters known to Cayenne.
+     * 
+     * @deprecated since 3.1 as {@link org.apache.cayenne.configuration.DbAdapterFactory}
+     *             parameter is required.
      */
     public AutoAdapter(DataSource dataSource) {
-        this(null, dataSource);
+        this((DbAdapterFactory) null, dataSource);
     }
 
     /**
      * Creates an AutoAdapter with specified adapter factory and DataSource. If
      * adapterFactory is null, default factory is used.
+     * 
+     * @deprecated since 3.1 in favor of
+     *             {@link org.apache.cayenne.configuration.DbAdapterFactory} configured
+     *             via dependency injection.
      */
-    public AutoAdapter(@Inject DbAdapterFactory adapterFactory,
-            @Inject DataSource dataSource) {
+    public AutoAdapter(DbAdapterFactory adapterFactory, final DataSource dataSource) {
         // sanity check
         if (dataSource == null) {
             throw new CayenneRuntimeException("Null dataSource");
         }
 
-        this.adapterFactory = adapterFactory != null
+        final DbAdapterFactory deprecatedFactory = adapterFactory != null
                 ? adapterFactory
                 : createDefaultFactory();
-        this.dataSource = dataSource;
+
+        this.adapterProvider = new Provider&lt;DbAdapter&gt;() {
+
+            public DbAdapter get() throws DIException {
+                DbAdapter adapter;
+
+                try {
+                    Connection c = dataSource.getConnection();
+
+                    try {
+                        adapter = deprecatedFactory.createAdapter(c.getMetaData());
+                    }
+                    finally {
+                        try {
+                            c.close();
+                        }
+                        catch (SQLException e) {
+                            // ignore...
+                        }
+                    }
+                }
+                catch (SQLException e) {
+                    throw new CayenneRuntimeException("Error detecting database type: "
+                            + e.getLocalizedMessage(), e);
+                }
+
+                if (adapter == null) {
+                    QueryLogger
+                            .log("Failed to detect database type, using default adapter");
+                    adapter = new JdbcAdapter();
+                }
+                else {
+                    QueryLogger.log("Detected and installed adapter: "
+                            + adapter.getClass().getName());
+                }
+
+                return adapter;
+            }
+        };
+
+    }
+
+    /**
+     * Creates an {@link AutoAdapter} based on a delegate adapter obtained via
+     * "adapterProvider".
+     * 
+     * @since 3.1
+     */
+    public AutoAdapter(Provider&lt;DbAdapter&gt; adapterProvider) {
+
+        if (adapterProvider == null) {
+            throw new CayenneRuntimeException("Null adapterProvider");
+        }
+
+        this.adapterProvider = adapterProvider;
     }
 
     /**
      * Called from constructor to initialize factory in case no factory was specified by
      * the object creator.
+     * 
+     * @deprecated since 3.1 in favor of
+     *             {@link org.apache.cayenne.configuration.DbAdapterFactory} configured
+     *             via dependency injection.
      */
     protected DbAdapterFactory createDefaultFactory() {
         return getDefaultFactory();
@@ -163,41 +241,10 @@
     }
 
     /**
-     * Opens a connection, retrieves JDBC metadata and attempts to guess adapter form it.
+     * Loads underlying DbAdapter delegate.
      */
     protected DbAdapter loadAdapter() {
-        DbAdapter adapter = null;
-
-        try {
-            Connection c = dataSource.getConnection();
-
-            try {
-                adapter = adapterFactory.createAdapter(c.getMetaData());
-            }
-            finally {
-                try {
-                    c.close();
-                }
-                catch (SQLException e) {
-                    // ignore...
-                }
-            }
-        }
-        catch (SQLException e) {
-            throw new CayenneRuntimeException("Error detecting database type: "
-                    + e.getLocalizedMessage(), e);
-        }
-
-        if (adapter == null) {
-            QueryLogger.log("Failed to detect database type, using default adapter");
-            adapter = new JdbcAdapter();
-        }
-        else {
-            QueryLogger.log("Detected and installed adapter: "
-                    + adapter.getClass().getName());
-        }
-
-        return adapter;
+        return adapterProvider.get();
     }
 
     // ---- DbAdapter methods ----
@@ -307,9 +354,6 @@
         getAdapter().createTableAppendColumn(sqlBuffer, column);
     }
 
-    public void setDefaultQuoteSqlIdentifiersChars(boolean isQuoteSqlIdentifiers) {
-    }
-
     public String getIdentifiersStartQuote() {
         return DEFAULT_QUOTE_SQL_IDENTIFIERS_CHAR_START;
     }
@@ -321,5 +365,4 @@
     public QuotingStrategy getQuotingStrategy(boolean isQuoteStrategy) {
         return getAdapter().getQuotingStrategy(isQuoteStrategy);
     }
-
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactory.java Sun Dec  6 11:22:19 2009
@@ -28,6 +28,9 @@
  * database based on version information and other metadata.
  * 
  * @since 1.2
+ * @deprecated since 3.1 in favor of
+ *             {@link org.apache.cayenne.configuration.DbAdapterFactory} configured via
+ *             dependency injection.
  */
 public interface DbAdapterFactory {
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java Sun Dec  6 11:22:19 2009
@@ -30,10 +30,10 @@
  * adapters known to Cayenne or can work with custom factories.
  * 
  * @since 1.2
+ * @deprecated since 3.1 in favor of
+ *             {@link org.apache.cayenne.configuration.DbAdapterFactory} configured via
+ *             dependency injection.
  */
-// TODO, Andrus 11/01/2005, how can custom adapters be auto-detected? I.e. is there a way
-// to plug a custom factory into configuration loading process? Of course users can simply
-// specify the adapter class in the modeler, so this may be a non-issue.
 class DbAdapterFactoryChain implements DbAdapterFactory {
 
     List&lt;DbAdapterFactory&gt; factories;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Sniffer.java Sun Dec  6 11:22:19 2009
@@ -22,13 +22,14 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
 /**
  * @since 1.2
  */
-public class DB2Sniffer implements DbAdapterFactory {
+public class DB2Sniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbySniffer.java Sun Dec  6 11:22:19 2009
@@ -22,6 +22,7 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -30,7 +31,7 @@
  * 
  * @since 1.2
  */
-public class DerbySniffer implements DbAdapterFactory {
+public class DerbySniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,13 +22,14 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
 /**
  * @since 1.2
  */
-public class FrontBaseSniffer implements DbAdapterFactory {
+public class FrontBaseSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/h2/H2Sniffer.java Sun Dec  6 11:22:19 2009
@@ -21,13 +21,15 @@
 
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
+
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
 /**
  * @since 3.0
  */
-public class H2Sniffer implements DbAdapterFactory {
+public class H2Sniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,6 +22,7 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -30,7 +31,7 @@
  * 
  * @since 1.2
  */
-public class HSQLDBSniffer implements DbAdapterFactory {
+public class HSQLDBSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,6 +22,7 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -30,7 +31,7 @@
  * 
  * @since 1.2
  */
-public class IngresSniffer implements DbAdapterFactory {
+public class IngresSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSniffer.java Sun Dec  6 11:22:19 2009
@@ -24,6 +24,7 @@
 import java.sql.SQLException;
 import java.sql.Statement;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -32,7 +33,7 @@
  * 
  * @since 1.2
  */
-public class MySQLSniffer implements DbAdapterFactory {
+public class MySQLSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,6 +22,7 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -30,7 +31,7 @@
  * 
  * @since 1.2
  */
-public class OpenBaseSniffer implements DbAdapterFactory {
+public class OpenBaseSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,13 +22,14 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
 /**
  * @since 1.2
  */
-public class OracleSniffer implements DbAdapterFactory {
+public class OracleSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,13 +22,14 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
 /**
  * @since 1.2
  */
-public class PostgresSniffer implements DbAdapterFactory {
+public class PostgresSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSniffer.java Sun Dec  6 11:22:19 2009
@@ -21,6 +21,7 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -29,7 +30,7 @@
  * 
  * @since 3.0
  */
-public class SQLiteSniffer implements DbAdapterFactory {
+public class SQLiteSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,6 +22,7 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -30,7 +31,7 @@
  * 
  * @since 1.2
  */
-public class SQLServerSniffer implements DbAdapterFactory {
+public class SQLServerSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
         String dbName = md.getDatabaseProductName();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sybase/SybaseSniffer.java Sun Dec  6 11:22:19 2009
@@ -22,6 +22,7 @@
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 
+import org.apache.cayenne.configuration.DbAdapterDetector;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.DbAdapterFactory;
 
@@ -30,7 +31,7 @@
  * 
  * @since 1.2
  */
-public class SybaseSniffer implements DbAdapterFactory {
+public class SybaseSniffer implements DbAdapterFactory, DbAdapterDetector {
 
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {    	
     	// JTDS driver returns "sql server" for Sybase, so need to handle it differently

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java?rev=887667&amp;r1=887666&amp;r2=887667&amp;view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/runtime/DataDomainProvider.java Sun Dec  6 11:22:19 2009
@@ -18,22 +18,24 @@
  ****************************************************************/
 package org.apache.cayenne.runtime;
 
-import org.apache.cayenne.CayenneRuntimeException;
+import javax.sql.DataSource;
+
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
+import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataChannelDescriptorLoader;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.configuration.DataSourceFactory;
+import org.apache.cayenne.configuration.DataSourceFactoryLoader;
+import org.apache.cayenne.configuration.DbAdapterFactory;
 import org.apache.cayenne.configuration.RuntimeProperties;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.di.DIException;
 import org.apache.cayenne.di.Inject;
-import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Provider;
 import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.util.Util;
 
 /**
  * A {@link DataChannel} provider that provides a single instance of DataDomain configured
@@ -53,13 +55,13 @@
     protected SchemaUpdateStrategy defaultSchemaUpdateStrategy;
 
     @Inject
-    protected DbAdapter defaultAdapter;
+    protected DbAdapterFactory adapterFactory;
 
     @Inject
-    protected DataSourceFactory defaultDataSourceFactory;
+    protected DataSourceFactoryLoader dataSourceFactoryLoader;
 
     @Inject
-    protected Injector injector;
+    protected AdhocObjectFactory objectFactory;
 
     protected volatile DataChannel dataChannel;
 
@@ -68,7 +70,17 @@
         if (dataChannel == null) {
             synchronized (this) {
                 if (dataChannel == null) {
-                    createDataChannel();
+
+                    try {
+                        createDataChannel();
+                    }
+                    catch (DIException e) {
+                        throw e;
+                    }
+                    catch (Exception e) {
+                        throw new DIException("Error loading DataChannel: '%s'", e, e
+                                .getMessage());
+                    }
                 }
             }
         }
@@ -76,7 +88,7 @@
         return dataChannel;
     }
 
-    protected void createDataChannel() {
+    protected void createDataChannel() throws Exception {
         String runtimeName = configurationProperties
                 .get(RuntimeProperties.CAYENNE_RUNTIME_NAME);
         DataChannelDescriptor descriptor = loader.load(runtimeName);
@@ -94,21 +106,13 @@
 
             dataNode.setDataSourceLocation(nodeDescriptor.getLocation());
 
-            String dataSourceFactoryType = nodeDescriptor.getDataSourceFactoryType();
-            if (dataSourceFactoryType == null) {
-                dataNode.setDataSourceFactory(defaultDataSourceFactory
-                        .getClass()
-                        .getName());
-                dataNode.setDataSource(defaultDataSourceFactory
-                        .getDataSource(nodeDescriptor));
-            }
-            else {
-                dataNode.setDataSourceFactory(dataSourceFactoryType);
-                DataSourceFactory factory = newInstance(
-                        DataSourceFactory.class,
-                        dataSourceFactoryType);
-                dataNode.setDataSource(factory.getDataSource(nodeDescriptor));
-            }
+            DataSourceFactory dataSourceFactory = dataSourceFactoryLoader
+                    .getDataSourceFactory(nodeDescriptor);
+
+            DataSource dataSource = dataSourceFactory.getDataSource(nodeDescriptor);
+
+            dataNode.setDataSourceFactory(nodeDescriptor.getDataSourceFactoryType());
+            dataNode.setDataSource(dataSource);
 
             // schema update strategy
             String schemaUpdateStrategyType = nodeDescriptor
@@ -121,20 +125,16 @@
                         .getName());
             }
             else {
-                dataNode.setSchemaUpdateStrategyName(schemaUpdateStrategyType);
-                dataNode.setSchemaUpdateStrategy(newInstance(
+
+                SchemaUpdateStrategy strategy = objectFactory.newInstance(
                         SchemaUpdateStrategy.class,
-                        schemaUpdateStrategyType));
+                        schemaUpdateStrategyType);
+                dataNode.setSchemaUpdateStrategyName(schemaUpdateStrategyType);
+                dataNode.setSchemaUpdateStrategy(strategy);
             }
 
             // DbAdapter
-            String adapterType = nodeDescriptor.getAdapterType();
-            if (adapterType == null) {
-                dataNode.setAdapter(defaultAdapter);
-            }
-            else {
-                dataNode.setAdapter(newInstance(DbAdapter.class, adapterType));
-            }
+            dataNode.setAdapter(adapterFactory.createAdapter(nodeDescriptor, dataSource));
 
             // DataMaps
             for (String dataMapName : nodeDescriptor.getDataMapNames()) {
@@ -147,32 +147,4 @@
         this.dataChannel = dataChannel;
     }
 
-    private &lt;T&gt; T newInstance(Class&lt;? extends T&gt; interfaceType, String className) {
-
-        Class&lt;? extends T&gt; type;
-        try {
-            type = (Class&lt;? extends T&gt;) Util.getJavaClass(className);
-        }
-        catch (ClassNotFoundException e) {
-            throw new CayenneRuntimeException(
-                    "Invalid class %s of type %s",
-                    e,
-                    className,
-                    interfaceType.getName());
-        }
-        T instance;
-        try {
-            instance = type.newInstance();
-        }
-        catch (Exception e) {
-            throw new CayenneRuntimeException(
-                    "Error creating instance of class %s of type %s",
-                    e,
-                    className,
-                    interfaceType.getName());
-        }
-
-        injector.injectMembers(instance);
-        return instance;
-    }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887666 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/conf/ConnectionPropertiesTest.java</title>
<author><name>aadamchik@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c20091206112111.D5610238899B@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091206112111-D5610238899B@eris-apache-org%3e</id>
<updated>2009-12-06T11:21:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: aadamchik
Date: Sun Dec  6 11:21:11 2009
New Revision: 887666

URL: http://svn.apache.org/viewvc?rev=887666&amp;view=rev
Log:
removing test case for the class that is itself located in the unit tests

Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/conf/ConnectionPropertiesTest.java



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1689554382.1259952800635.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1689554382-1259952800635-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T18:53:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12786069#action_12786069
] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

[Andrus] This is a new use pattern of ExtendedTypes (till now 'materializeObject' would always
return the same class or a subclass of 'getClassName'... I guess it's fine to trick Oracle.
Also Oracle has a few more odd types:

http://download-east.oracle.com/otn_hosted_doc/jdeveloper/904preview/jdbc-javadoc/oracle/sql/package-summary.html

that we may want to handle in a similar fashion (at least the date/time ones) 


Re:
Love to do something new :)
Yeah! It's a large field of Oracle tunning.
Next step I am going to work with Oracle CLOBs. (Some fellas from my work have troubles with
it). I have some logs.... but not even looked inside... yet.. 

&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Evgeny Ryabitskiy
&gt;         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml,
OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c602803795.1259952440695.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c602803795-1259952440695-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T18:47:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12786065#action_12786065
] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

[Andrus] Not a bad idea, however 'getDate' would lose all time data, so what if that weird
object returned by the driver is a custom timestamp... Should we call 'getTimestamp()' instead?
Something to figure out. 

Re;
It's UtilDateType.java  class and  it's expecting to return java.util.Date.

 'getDate'  returns 'java.sql.Date'
There are no deferents between 'java.sql.Date'  and ' java.util.Date'

if we use 'getTimestamp()' we got 'java.sql.Timestamp'
Only deferents between Timestamp and Date is nanoseconds.
We don't need nanoseconds, because we converting to ' java.util.Date' and nanoseconds will
be dropped.

So I think it is right method in right place. No lose of time data.

&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Evgeny Ryabitskiy
&gt;         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml,
OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Assigned: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Andrus Adamchik (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1151066166.1259942781045.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1151066166-1259942781045-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T16:06:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik reassigned CAY-1323:
------------------------------------

    Assignee: Evgeny Ryabitskiy  (was: Andrus Adamchik)

Cool. Assigning this to Evgeny.

Good stuff. See my comments inline below...


Index: src/main/java/org/apache/cayenne/access/types/UtilDateType.java
===================================================================
-    public Object materializeObject(ResultSet rs, int index, int type) throws Exception {
+    public Date materializeObject(ResultSet rs, int index, int type) throws Exception {
         Date val = null;
 
         switch (type) {
@@ -70,28 +69,18 @@
                 val = rs.getTime(index);
                 break;
             default:
-                // here the driver can "surprise" us
-                // check the type of returned value...
-                Object object = rs.getObject(index);
-
-                if (object != null &amp;&amp; !(object instanceof Date)) {
-                    throw new CayenneRuntimeException(
-                            "Expected an instance of java.util.Date, instead got "
-                                    + object.getClass().getName()
-                                    + ", column index: "
-                                    + index);
-                }
-
-                val = (Date) object;
+                val = rs.getDate(index);
                 break;
         }

[Andrus] Not a bad idea, however 'getDate' would lose all time data, so what if that weird
object returned by the driver is a custom timestamp... Should we call 'getTimestamp()' instead?
Something to figure out.


Index: src/main/java/org/apache/cayenne/dba/oracle/OracleTimestampType.java
===================================================================
+
+/**
+ * This is handler for Oracle specific type "oracle.sql.TIMESTAMP"
+ * Oracle official JDBC Driver is mapping SQL TIMESTAMP to this type
+ * Created to solve CAY-1323.
+ */
+public class OracleTimestampType extends TimestampType {
+
+    @Override
+    public String getClassName() {
+        return "oracle.sql.TIMESTAMP";
+    }
+}

[Andrus] This is a new use pattern of ExtendedTypes (till now 'materializeObject' would always
return the same class or a subclass of 'getClassName'... I guess it's fine to trick Oracle.
Also Oracle has a few more odd types:

http://download-east.oracle.com/otn_hosted_doc/jdeveloper/904preview/jdbc-javadoc/oracle/sql/package-summary.html

that we may want to handle in a similar fashion (at least the date/time ones)

&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Evgeny Ryabitskiy
&gt;         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml,
OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Issue Comment Edited: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1482236838.1259941820827.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1482236838-1259941820827-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T15:50:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12785966#action_12785966
] 

Evgeny Ryabitskiy edited comment on CAY-1323 at 12/4/09 3:48 PM:
-----------------------------------------------------------------

Fixed!
Improved Timestamp/Date mapping for most of cases

Patch is only for 3.1 trunk.

Still need to think what to do with other branches

      was (Author: apparition):
    Fixed!
Improved Timestamp/Date mapping for most of cases
  
&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Andrus Adamchik
&gt;         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml,
OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c153264771.1259941700744.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c153264771-1259941700744-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T15:48:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12785968#action_12785968
] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

Maybe assign this issue to me.. cause I am resolving it? :)

&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Andrus Adamchik
&gt;         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml,
OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c27123555.1259941580631.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c27123555-1259941580631-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T15:46:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: CAY-1323_3.1_OracleTest.patch

JUnits to check Oracle Date/Timestamp Mapping

&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Andrus Adamchik
&gt;         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml,
OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query</title>
<author><name>&quot;Evgeny Ryabitskiy (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1837678041.1259941460747.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1837678041-1259941460747-JavaMail-jira@brutus%3e</id>
<updated>2009-12-04T15:44:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: CAY-1323_3.1.patch

Fixed!
Improved Timestamp/Date mapping for most of cases

&gt; oracle.sql.TIMESTAMP in Result of query
&gt; ---------------------------------------
&gt;
&gt;                 Key: CAY-1323
&gt;                 URL: https://issues.apache.org/jira/browse/CAY-1323
&gt;             Project: Cayenne
&gt;          Issue Type: Bug
&gt;          Components: Cayenne Core Library
&gt;    Affects Versions: 2.0.5, 3.0 beta 1
&gt;            Reporter: Evgeny Ryabitskiy
&gt;            Assignee: Andrus Adamchik
&gt;         Attachments: CAY-1323_3.1.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
&gt;
&gt;
&gt; Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
&gt; I think it should be mapped to standard JDBS TIMESTAMP
&gt; I am using latest official Oracle JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[CONF] Apache Cayenne Documentation &gt; Tutorial Setup</title>
<author><name>confluence@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1842931107.535.1259870040012.JavaMail.www-data@brutus%3e"/>
<id>urn:uuid:%3c1842931107-535-1259870040012-JavaMail-www-data@brutus%3e</id>
<updated>2009-12-03T19:54:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://cwiki.apache.org/confluence"&gt;
            &lt;link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAYDOC&amp;amp;forWysiwyg=true"
type="text/css"&gt;
    &lt;/head&gt;
&lt;body style="background-color: white" bgcolor="white"&gt;
&lt;div id="pageContent"&gt;
&lt;div id="notificationFormat"&gt;
&lt;div class="wiki-content"&gt;
&lt;div class="email"&gt;
     &lt;h2&gt;&lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/Tutorial+Setup"&gt;Tutorial
Setup&lt;/a&gt;&lt;/h2&gt;
     &lt;h4&gt;Page &lt;b&gt;edited&lt;/b&gt; by             &lt;a href="http://cwiki.apache.org/confluence/display/~andrus"&gt;Andrus
Adamchik&lt;/a&gt;
    &lt;/h4&gt;
     
          &lt;br/&gt;
     &lt;div class="notificationGreySide"&gt;
         &lt;h3&gt;&lt;a name="TutorialSetup-InstallJava"&gt;&lt;/a&gt;Install Java&lt;/h3&gt;

&lt;p&gt;Make sure you have Java installed. Cayenne 3.0 requires JDK 1.5 or newer.&lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-DownloadCayenne"&gt;&lt;/a&gt;Download Cayenne&lt;/h3&gt;

&lt;p&gt;Get &lt;a href="http://cayenne.apache.org/download.html" rel="nofollow"&gt;the latest
Cayenne&lt;/a&gt; distribution. If you are on Linux, select a cross-platform version (&lt;tt&gt;cayenne-XXX.tar.gz&lt;/tt&gt;).
 For Mac OS X select &lt;tt&gt;cayenne-XXX-macosx.dmg&lt;/tt&gt; and for Windows - &lt;tt&gt;cayenne-XXX-win.zip&lt;/tt&gt;.
Unpack the distribution somewhere in the file system. &lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-DownloadDerbyDatabase"&gt;&lt;/a&gt;Download Derby Database&lt;/h3&gt;

&lt;p&gt;Get Derby database &lt;a href="http://db.apache.org/derby/derby_downloads.html" rel="nofollow"&gt;from
here&lt;/a&gt; and unpack it somewhere in the filesystem.&lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-DownloadEclipse"&gt;&lt;/a&gt;Download Eclipse &lt;/h3&gt;

&lt;p&gt;Download Eclipse &lt;a href="http://www.eclipse.org" rel="nofollow"&gt;from here&lt;/a&gt;
and unpack it somewhere in the filesystem.&lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-CreateaNewEclipseProject"&gt;&lt;/a&gt;Create a New Eclipse
Project&lt;/h3&gt;

&lt;p&gt;Start Eclipse and go to &lt;tt&gt;"File &amp;gt; New &amp;gt; Project"&lt;/tt&gt;.
Select a "Java Project" for the project type and click "Next":&lt;/p&gt;

&lt;p&gt;&lt;img src="/confluence/download/attachments/10642/eclipse-new-project.jpg" align="absmiddle"
border="0" /&gt;&lt;/p&gt;

&lt;p&gt;Enter "cayenne-tutorial" for the project name, select "Create separate source and
output folders" radio button and click "Next":&lt;/p&gt;

&lt;p&gt;&lt;img src="/confluence/download/attachments/10642/eclipse-project-settings.jpg"
align="absmiddle" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;On the next screen ("Java Settings") go to the "Libraries" tab and click "Add External
Jar" button on the right to add two Jar files:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;derby.jar&lt;/tt&gt; located in the "lib" directory of the Derby installation)&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;cayenne.jar&lt;/tt&gt; located in the "lib" directory of Cayenne installation.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;img src="/confluence/download/attachments/10642/eclipse-java-settings.jpg" align="absmiddle"
border="0" /&gt;&lt;/p&gt;

&lt;p&gt;When done click "Finish" and the new project should appear in Eclipse.&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;&lt;b&gt;Next Step: &lt;a href="/confluence/display/CAYDOC/Tutorial+Starting+Mapping+Project"
title="Tutorial Starting Mapping Project"&gt;Tutorial Starting Mapping Project&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;hr /&gt;
     &lt;/div&gt;
     &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
       &lt;div style="float: right;"&gt;
            &lt;a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey"&gt;Change Notification Preferences&lt;/a&gt;
       &lt;/div&gt;

       &lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/Tutorial+Setup"&gt;View
Online&lt;/a&gt;
       |
       &lt;a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=10642&amp;revisedVersion=11&amp;originalVersion=10"&gt;View
Change&lt;/a&gt;
              |
       &lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/Tutorial+Setup?showComments=true&amp;amp;showCommentArea=true#addcomment"&gt;Add
Comment&lt;/a&gt;
            &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>[CONF] Apache Cayenne Documentation &gt; Tutorial Setup</title>
<author><name>confluence@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c183834974.534.1259869980027.JavaMail.www-data@brutus%3e"/>
<id>urn:uuid:%3c183834974-534-1259869980027-JavaMail-www-data@brutus%3e</id>
<updated>2009-12-03T19:53:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://cwiki.apache.org/confluence"&gt;
            &lt;link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAYDOC&amp;amp;forWysiwyg=true"
type="text/css"&gt;
    &lt;/head&gt;
&lt;body style="background-color: white" bgcolor="white"&gt;
&lt;div id="pageContent"&gt;
&lt;div id="notificationFormat"&gt;
&lt;div class="wiki-content"&gt;
&lt;div class="email"&gt;
     &lt;h2&gt;&lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/Tutorial+Setup"&gt;Tutorial
Setup&lt;/a&gt;&lt;/h2&gt;
     &lt;h4&gt;Page &lt;b&gt;edited&lt;/b&gt; by             &lt;a href="http://cwiki.apache.org/confluence/display/~andrus"&gt;Andrus
Adamchik&lt;/a&gt;
    &lt;/h4&gt;
     
          &lt;br/&gt;
     &lt;div class="notificationGreySide"&gt;
         &lt;h3&gt;&lt;a name="TutorialSetup-InstallJava"&gt;&lt;/a&gt;Install Java&lt;/h3&gt;

&lt;p&gt;Make sure you have Java installed. Cayenne 3.0 requires JDK 1.5.&lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-DownloadCayenne"&gt;&lt;/a&gt;Download Cayenne&lt;/h3&gt;

&lt;p&gt;Get &lt;a href="http://cayenne.apache.org/download.html" rel="nofollow"&gt;the latest
Cayenne&lt;/a&gt; distribution. If you are on Linux, select a cross-platform version (&lt;tt&gt;cayenne-XXX.tar.gz&lt;/tt&gt;).
 For Mac OS X select &lt;tt&gt;cayenne-XXX-macosx.dmg&lt;/tt&gt; and for Windows - &lt;tt&gt;cayenne-XXX-win.zip&lt;/tt&gt;.
Unpack the distribution somewhere in the file system. &lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-DownloadDerbyDatabase"&gt;&lt;/a&gt;Download Derby Database&lt;/h3&gt;

&lt;p&gt;Get Derby database &lt;a href="http://db.apache.org/derby/derby_downloads.html" rel="nofollow"&gt;from
here&lt;/a&gt; and unpack it somewhere in the filesystem.&lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-DownloadEclipse"&gt;&lt;/a&gt;Download Eclipse &lt;/h3&gt;

&lt;p&gt;Download Eclipse &lt;a href="http://www.eclipse.org" rel="nofollow"&gt;from here&lt;/a&gt;
and unpack it somewhere in the filesystem.&lt;/p&gt;

&lt;h3&gt;&lt;a name="TutorialSetup-CreateaNewEclipseProject"&gt;&lt;/a&gt;Create a New Eclipse
Project&lt;/h3&gt;

&lt;p&gt;Start Eclipse and go to &lt;tt&gt;"File &amp;gt; New &amp;gt; Project"&lt;/tt&gt;.
Select a "Java Project" for the project type and click "Next":&lt;/p&gt;

&lt;p&gt;&lt;img src="/confluence/download/attachments/10642/eclipse-new-project.jpg" align="absmiddle"
border="0" /&gt;&lt;/p&gt;

&lt;p&gt;Enter "cayenne-tutorial" for the project name, select "Create separate source and
output folders" radio button and click "Next":&lt;/p&gt;

&lt;p&gt;&lt;img src="/confluence/download/attachments/10642/eclipse-project-settings.jpg"
align="absmiddle" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;On the next screen ("Java Settings") go to the "Libraries" tab and click "Add External
Jar" button on the right to add two Jar files:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;derby.jar&lt;/tt&gt; located in the "lib" directory of the Derby installation)&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;cayenne.jar&lt;/tt&gt; located in the "lib" directory of Cayenne installation.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;img src="/confluence/download/attachments/10642/eclipse-java-settings.jpg" align="absmiddle"
border="0" /&gt;&lt;/p&gt;

&lt;p&gt;When done click "Finish" and the new project should appear in Eclipse.&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;&lt;b&gt;Next Step: &lt;a href="/confluence/display/CAYDOC/Tutorial+Starting+Mapping+Project"
title="Tutorial Starting Mapping Project"&gt;Tutorial Starting Mapping Project&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;hr /&gt;
     &lt;/div&gt;
     &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
       &lt;div style="float: right;"&gt;
            &lt;a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey"&gt;Change Notification Preferences&lt;/a&gt;
       &lt;/div&gt;

       &lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/Tutorial+Setup"&gt;View
Online&lt;/a&gt;
       |
       &lt;a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=10642&amp;revisedVersion=10&amp;originalVersion=9"&gt;View
Change&lt;/a&gt;
              |
       &lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/Tutorial+Setup?showComments=true&amp;amp;showCommentArea=true#addcomment"&gt;Add
Comment&lt;/a&gt;
            &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>[CONF] Apache Cayenne Documentation &gt; JAR Files and Dependencies</title>
<author><name>confluence@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/cayenne-commits/200912.mbox/%3c1986293146.526.1259868900021.JavaMail.www-data@brutus%3e"/>
<id>urn:uuid:%3c1986293146-526-1259868900021-JavaMail-www-data@brutus%3e</id>
<updated>2009-12-03T19:35:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://cwiki.apache.org/confluence"&gt;
            &lt;link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAYDOC&amp;amp;forWysiwyg=true"
type="text/css"&gt;
    &lt;/head&gt;
&lt;body style="background-color: white" bgcolor="white"&gt;
&lt;div id="pageContent"&gt;
&lt;div id="notificationFormat"&gt;
&lt;div class="wiki-content"&gt;
&lt;div class="email"&gt;
     &lt;h2&gt;&lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/JAR+Files+and+Dependencies"&gt;JAR
Files and Dependencies&lt;/a&gt;&lt;/h2&gt;
     &lt;h4&gt;Page &lt;b&gt;edited&lt;/b&gt; by             &lt;a href="http://cwiki.apache.org/confluence/display/~andrus"&gt;Andrus
Adamchik&lt;/a&gt;
    &lt;/h4&gt;
     
          &lt;br/&gt;
     &lt;div class="notificationGreySide"&gt;
         &lt;p&gt;This sections explains where all the relevant jar files are located. It
also lists Cayenne dependencies.&lt;/p&gt;

&lt;h3&gt;&lt;a name="JARFilesandDependencies-CayenneRuntimeFramework"&gt;&lt;/a&gt;Cayenne
Runtime Framework&lt;/h3&gt;

&lt;p&gt;The following runtime jars are included in Cayenne distribution &lt;tt&gt;"lib"&lt;/tt&gt;
directory:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;b&gt;&lt;tt&gt;cayenne-server-x.x.jar&lt;/tt&gt;&lt;/b&gt; - contains full
Cayenne runtime WITHOUT dependencies. Most applications will use only this file.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;cayenne-client-x.x.jar&lt;/tt&gt; - a subset of cayenne-server.jar trimmed
for use on the client in an &lt;a href="/confluence/display/CAYDOC/Remote+Object+Persistence+Guide"
title="Remote Object Persistence Guide"&gt;ROP application&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;cayenne-tools-x.x.jar&lt;/tt&gt; - Ant tasks&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;cayenne-modeler-x.x.jar&lt;/tt&gt; - CayenneModeler runtime library.
Most applications won't ever use it. It is only needed for the &lt;a href="/confluence/display/CAYDOC/Using+JNDI"
title="Using JNDI"&gt;local JNDI hack&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When using &lt;tt&gt;cayenne-server-x.x.jar&lt;/tt&gt; you'll need a few third party
jars (all included in &lt;tt&gt;"lib/third-party"&lt;/tt&gt; directory of the distribution):&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://objectstyle.org/ashwood/" rel="nofollow"&gt;ObjectStyle Ashwood
Graph Library&lt;/a&gt;, version 2.0&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://jakarta.apache.org/velocity/" rel="nofollow"&gt;Apache Velocity
Template Engine&lt;/a&gt;, version 1.3 (and all its dependencies bundled with velocity-dep)&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://jakarta.apache.org/commons/collections" rel="nofollow"&gt;Apache
Commons Collections&lt;/a&gt;, version 3.1&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://jakarta.apache.org/commons/logging/" rel="nofollow"&gt;Apache
Commons Logging&lt;/a&gt;, version 1.1&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;ROP client dependencies are explained &lt;a href="/confluence/display/CAYDOC/Remote+Object+Persistence+Installation"
title="Remote Object Persistence Installation"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;&lt;a name="JARFilesandDependencies-OptionalRuntimeDependencies"&gt;&lt;/a&gt;Optional
Runtime Dependencies&lt;/h3&gt;

&lt;p&gt;One or more of the following libraries may be needed depending on how you use Cayenne:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://ant.apache.org/" rel="nofollow"&gt;Apache Ant&lt;/a&gt;, version
1.6 or newer. Needed for &lt;a href="/confluence/display/CAYDOC/Ant+Tasks" title="Ant Tasks"&gt;Cayenne
Ant Tasks&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://jakarta.apache.org/commons/pool/" rel="nofollow"&gt;Apache Commons
Pool&lt;/a&gt;, version 1.2 and &lt;a href="http://jakarta.apache.org/commons/dbcp/" rel="nofollow"&gt;Apache
Commons DBCP&lt;/a&gt;, version 1.2.1. Needed if you use DBCPDataSourceFactory for one of
the DataNodes.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.jgroups.org/" rel="nofollow"&gt;JGroups&lt;/a&gt;, version
2.2.7 or newer. Needed if you plan to use remote notifications via JGroups transport.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://java.sun.com/products/jms/" rel="nofollow"&gt;Java Messaging
Service (JMS)&lt;/a&gt;. Needed if you plan to use remote notifications via JMS transport.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://vpp.sourceforge.net/" rel="nofollow"&gt;Foundry Logic VPP Library&lt;/a&gt;,
version 2.2.1 (included in &lt;tt&gt;"lib/third-party"&lt;/tt&gt; directory of the distribution).
Needed for &lt;a href="/confluence/display/CAYDOC/cgen" title="cgen"&gt;class generation options&lt;/a&gt;
with Ant.&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.opensymphony.com/oscache/" rel="nofollow"&gt;OSCache&lt;/a&gt;
version 2.3.2 or newer. Needed if you plan to use OSCache as your &lt;a href="/confluence/display/CAYDOC/Query+Result+Caching"
title="Query Result Caching"&gt;query results cache provider&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

     &lt;/div&gt;
     &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
       &lt;div style="float: right;"&gt;
            &lt;a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey"&gt;Change Notification Preferences&lt;/a&gt;
       &lt;/div&gt;

       &lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/JAR+Files+and+Dependencies"&gt;View
Online&lt;/a&gt;
       |
       &lt;a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=10589&amp;revisedVersion=20&amp;originalVersion=19"&gt;View
Change&lt;/a&gt;
              |
       &lt;a href="http://cwiki.apache.org/confluence/display/CAYDOC/JAR+Files+and+Dependencies?showComments=true&amp;amp;showCommentArea=true#addcomment"&gt;Add
Comment&lt;/a&gt;
            &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
</feed>
