FAQ
Hi all.
I just stumbled into a problem where two of my cayenne projects have the same entity name (but different DataObject classes, of course) and this is causing conflicts in behaviour, when both projects are running in the same ServerRuntime.

I’m guessing I’m pretty much borked and should rename one of the entities?

Are people using any method for namespacing their entities in Cayenne? In EOF we usually added a prefix to the entity name to avoid stuff like this.

Cheers,
- hugi

Search Discussions

  • Andrus Adamchik at Mar 28, 2016 at 5:11 pm
    Yes, ObjEntity name should be unique in the runtime. Like you said it is easy to fix by renaming. I think we should start using DataMaps for namespacing in Cayenne eventually.

    Hope your *table* names are different though. Here is a real namespacing bug that needs to be addressed:

    https://issues.apache.org/jira/browse/CAY-2036
    https://issues.apache.org/jira/browse/CAY-1152

    Andrus

    On Mar 26, 2016, at 7:31 PM, Hugi Thordarson wrote:

    Hi all.
    I just stumbled into a problem where two of my cayenne projects have the same entity name (but different DataObject classes, of course) and this is causing conflicts in behaviour, when both projects are running in the same ServerRuntime.

    I’m guessing I’m pretty much borked and should rename one of the entities?

    Are people using any method for namespacing their entities in Cayenne? In EOF we usually added a prefix to the entity name to avoid stuff like this.

    Cheers,
    - hugi
  • Hugi Thordarson at Mar 28, 2016 at 5:19 pm
    Thanks Andrus, I suspected this was the case. Fortunately the table names are different, so I’m not hitting the other bugs. But having each datamap live in it’s own namespace would be awesome.

    Maybe Cayenne should warn the user when there are two ObjEntities with the same name? Even throw an exception and shut down?

    One question: Can I use periods in the ObjEntity name? I.e. is there anything against me using the fully qualified class name as the entity name?

    Cheers,
    - hugi


    On 28. mar. 2016, at 17:11, Andrus Adamchik wrote:

    Yes, ObjEntity name should be unique in the runtime. Like you said it is easy to fix by renaming. I think we should start using DataMaps for namespacing in Cayenne eventually.

    Hope your *table* names are different though. Here is a real namespacing bug that needs to be addressed:

    https://issues.apache.org/jira/browse/CAY-2036
    https://issues.apache.org/jira/browse/CAY-1152

    Andrus

    On Mar 26, 2016, at 7:31 PM, Hugi Thordarson wrote:

    Hi all.
    I just stumbled into a problem where two of my cayenne projects have the same entity name (but different DataObject classes, of course) and this is causing conflicts in behaviour, when both projects are running in the same ServerRuntime.

    I’m guessing I’m pretty much borked and should rename one of the entities?

    Are people using any method for namespacing their entities in Cayenne? In EOF we usually added a prefix to the entity name to avoid stuff like this.

    Cheers,
    - hugi
  • Andrus Adamchik at Mar 28, 2016 at 5:22 pm

    On Mar 28, 2016, at 8:18 PM, Hugi Thordarson wrote:

    One question: Can I use periods in the ObjEntity name? I.e. is there anything against me using the fully qualified class name as the entity name?
    I've never tried, but I think you can.

    A.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedMar 26, '16 at 4:31p
activeMar 28, '16 at 5:22p
posts4
users2
websitecayenne.apache.org

People

Translate

site design / logo © 2019 Grokbase