DDC-3299: Possibility to define Entities in separate Bounded Context #4077

Closed
opened 2026-01-22 14:34:44 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 9, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user piteer1:

It would be great to have a possibility to define two entities in different Bounded Context. For now it's possible without a problem to use such an Entities but it's impossible to use schema tools, when two separate Entities map to the same table.

Originally created by @doctrinebot on GitHub (Sep 9, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user piteer1: It would be great to have a possibility to define two entities in different Bounded Context. For now it's possible without a problem to use such an Entities but it's impossible to use schema tools, when two separate Entities map to the same table.
admin added the Improvement label 2026-01-22 14:34:44 +01:00
admin closed this issue 2026-01-22 14:34:45 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 10, 2014):

Comment created by @ocramius:

This feature would break a very important invariant existing in the ORM: only one entity for a particular identifier existing in memory at any time.

This cannot be implemented, and actually goes against the rules imposed by the ORM.

The only solution to this problem would be to have a writable view, and mapping an entity to it, and an entity to the actual table: that's still making some of the transactions in your application very risky.

@doctrinebot commented on GitHub (Sep 10, 2014): Comment created by @ocramius: This feature would break a very important invariant existing in the ORM: only one entity for a particular identifier existing in memory at any time. This cannot be implemented, and actually goes against the rules imposed by the ORM. The only solution to this problem would be to have a writable view, and mapping an entity to it, and an entity to the actual table: that's still making some of the transactions in your application very risky.
Author
Owner

@doctrinebot commented on GitHub (Sep 10, 2014):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Sep 10, 2014): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Sep 12, 2014):

Comment created by piteer1:

But wouldn't it be possible to implement it really similar to single table inheritance but without a DiscriminatorColumn? Which instance would be returned would depend on the repository used.

@doctrinebot commented on GitHub (Sep 12, 2014): Comment created by piteer1: But wouldn't it be possible to implement it really similar to single table inheritance but without a DiscriminatorColumn? Which instance would be returned would depend on the repository used.
Author
Owner

@doctrinebot commented on GitHub (Sep 13, 2014):

Comment created by @ocramius:

[~piteer1] that wouldn't prevent having two instances of the same entity in memory, which is a problem.

@doctrinebot commented on GitHub (Sep 13, 2014): Comment created by @ocramius: [~piteer1] that wouldn't prevent having two instances of the same entity in memory, which is a problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4077