cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Switching data nodes at runtime
Date Mon, 26 Sep 2011 15:35:21 GMT
Hi John,

This is completely untested, but try something like:

Configuration  configuration = Configuration.getSharedConfiguration();
DataDomain  dataDomain = configuration.getDomain();
DataMap  dataMap = dataDomain.getMap("my map name");
DataNode  oldNode = dataDomain.getNode("old node name);
DataNode  newNode = dataDomain.getNode("new node name);

oldNode.removeDataMap(dataMap);
newNode.addDataMap(dataMap);
dataDomain.reindexNodes(); // maybe

mrg


On Mon, Sep 26, 2011 at 10:49 AM, John Huss <johnthuss@gmail.com> wrote:
> At runtime how do I switch my model to use a different data node that was
> previously defined in the in model?  I'm using trunk.
>
> Thanks,
> John
>

Mime
View raw message