cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emerson CastaƱeda <>
Subject Re: Cayenne And SpringBoot
Date Tue, 13 Aug 2019 18:09:33 GMT
I got this working using this approach:


//for persistency
compile 'org.apache.cayenne:cayenne-server:X.Y'
compile 'org.apache.cayenne:cayenne-java8:X.Y'
compile ''


        name: app-api
                username: user
                password: pwd
                driver: oracle.jdbc.driver.OracleDriver

*Configuration class:*

public class DataProviderService {
private static final Logger logger =
List<ObjectContext> cayenneContexts = null;
private MyBeanPropertyReader myBeanPropertyReader;

private  ObjectContext cayenneContext(String user, String password,String
url, String driver) {
ServerRuntimeBuilder b = ServerRuntime.builder();
b = b.url(url);
b = b.jdbcDriver(driver);
b = b.user(user);
b = b.password(password);
b = b.addConfigs("cayenne-ExistentFacultyPortfolio.xml");
ServerRuntime cayenneRuntime =;
return cayenneRuntime.newContext();

private void init(){
cayenneContexts =

logger.debug("DataProviderService init APPLICATION");

oc -> oc.getEntityResolver()
.forEach(dm -> logger.debug("DATAMAP : "+dm.getName())));

//any other method using the context


private DataProviderService dataProviderService;


datanode and datamap are located in the usual place: src/main/resourcesMy

On Tue, Aug 13, 2019 at 12:29 PM Tony Giaccone <> wrote:

> I want to look into using Cayenne with SpringBoot.  I was able to get a
> basic cayenne stack up and running by implementing a ContextListener  and
> on the create event starting up a Cayenne Runtime.  I was using an in
> memory database and I had problems getting the ;create=true working.  My
> hack was to set the strategy on the DataNode after the runtime after it
> was  spun up.
> Has anyone done this before?  Are there any  suggestions  on what I should
> be certain to do or avoid? Should I just spin up the standard Cayenne web
> filter?  Are there other choices?
> Thanks for any help you can provide.
> Tony

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message