You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Kumar <ku...@gmail.com> on 2017/01/01 16:14:43 UTC

How to define Multiple datamap.xml files

Guys,

A quick question. I am working on a project where we have around 2600 db
entities. Currently my datamap.xml contains all the dbentity, objentity,
dbrelationship and objrelationship. But the xml is too big and opening the
xml and doing any changes seems very laggy.

I heard that we can have multiple datamap.xml files and configure it in the
cayenne-project.xml. Currently i defined few of my mapped queries in a
separate xml and added that xml in the cayenne-project.xml. It is working
as expected.

Same like that can i move few of my dbentity, objentity,
dbrelationship and objrelationship to
a separate datamap.xml file?
I tried but not working. Do i need to follow any order?

Thanks in Advance,
Kumar.

Re: How to define Multiple datamap.xml files

Posted by Andrus Adamchik <an...@objectstyle.org>.
You don't need to do anything special. You just create as many DataMaps in your project as needed. You can have relationships between entities in different DataMaps. Though if you can avoid such relationships, it usually results in a model that is easier to manage.

Andrus

> On Jan 1, 2017, at 7:14 PM, Kumar <ku...@gmail.com> wrote:
> 
> Guys,
> 
> A quick question. I am working on a project where we have around 2600 db
> entities. Currently my datamap.xml contains all the dbentity, objentity,
> dbrelationship and objrelationship. But the xml is too big and opening the
> xml and doing any changes seems very laggy.
> 
> I heard that we can have multiple datamap.xml files and configure it in the
> cayenne-project.xml. Currently i defined few of my mapped queries in a
> separate xml and added that xml in the cayenne-project.xml. It is working
> as expected.
> 
> Same like that can i move few of my dbentity, objentity,
> dbrelationship and objrelationship to
> a separate datamap.xml file?
> I tried but not working. Do i need to follow any order?
> 
> Thanks in Advance,
> Kumar.