cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Handling multiple databases using Cayenne+Spring
Date Wed, 07 Apr 2010 08:39:10 GMT
There are a few samples in Cayenne itself. E.g.:

https://svn.apache.org/repos/asf/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java

Or a more complex one, parsing XML file:

https://svn.apache.org/repos/asf/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java

"Location" is a bit of a misnomer (and will be renamed in the new  
versions of Cayenne). This is really an arbitrary String understood by  
the factory and meaningless to Cayenne, that is stored in cayenne.xml  
and passed by Cayenne to the factory 'getDataSource' method. So e.g.  
you can use that parameter to give your factory a hint on what  
platform you are on or something.

Hopes that clarifies it a bit.

Andrus

On Apr 7, 2010, at 11:31 AM, Sudheer wrote:

>
> Thank you for the response.
>
> Can I have sample code for this? or reference document explaining  
> how to do.
>
> Actually I am coonfused with the approach. Within modeler, for the  
> custom
> data source factory, location is mandatory. I would like to know how
> cayenne.xml looks like while customizing data source factory?
>
> Can we create multiple domains in Cayenne modeler to support different
> platforms? or within single domain do we need to create multiple  
> nodes?
>
> Thank You,
> Sudheer
> -- 
> View this message in context: http://n3.nabble.com/Handling-multiple-databases-using-Cayenne-Spring-tp699967p702422.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
>


Mime
View raw message