DDC-2045: Unit of work use all columns for insert #2579

Closed
opened 2026-01-22 13:57:27 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 27, 2012).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user coviex:

I use MySQL. And I'm OK with default values that will be assigned by DB for columns which values I don't set explicitly. But Doctrine seems to unable to skip some columns when building insert SQL query.

People suggest to use nullable flag to enable desired behaviour. And I don't see how it could help. I checked UnitOfWork.php and BasicEntityPersister.php. There is nothing about nullable.
And doc http://docs.doctrine-project.org/en/latest/reference/limitations-and-known-issues.html says that you cannot use custom persisters so far.

So why not track changes for unsaved entities as well, and don't force applications to generate more traffic with more SQL text and developers to set default values in entity constructors?

I would be glad if I'm mistaken and this feature is already implemented and you describe how to resolve the issue. Thanks

Originally created by @doctrinebot on GitHub (Sep 27, 2012). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user coviex: I use MySQL. And I'm OK with default values that will be assigned by DB for columns which values I don't set explicitly. But Doctrine seems to unable to skip some columns when building insert SQL query. People suggest to use nullable flag to enable desired behaviour. And I don't see how it could help. I checked UnitOfWork.php and BasicEntityPersister.php. There is nothing about nullable. And doc http://docs.doctrine-project.org/en/latest/reference/limitations-and-known-issues.html says that you cannot use custom persisters so far. So why not track changes for unsaved entities as well, and don't force applications to generate more traffic with more SQL text and developers to set default values in entity constructors? I would be glad if I'm mistaken and this feature is already implemented and you describe how to resolve the issue. Thanks
admin added the Bug label 2026-01-22 13:57:27 +01:00
admin closed this issue 2026-01-22 13:57:28 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 23, 2013):

Comment created by @ocramius:

[~coviex] the nullable flag is a mapping used in columns. See http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#annref-column

Also, Doctrine does not skip columns since default DB-side values are not supported by the ORM. To have default values, you usually set them in the entity's constructor.

@doctrinebot commented on GitHub (Jan 23, 2013): Comment created by @ocramius: [~coviex] the `nullable` flag is a mapping used in columns. See http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#annref-column Also, Doctrine does not skip columns since default DB-side values are not supported by the ORM. To have default values, you usually set them in the entity's constructor.
Author
Owner

@doctrinebot commented on GitHub (Jan 23, 2013):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (Jan 23, 2013): Issue was closed with resolution "Won't Fix"
Author
Owner

@doctrinebot commented on GitHub (May 13, 2013):

Comment created by coviex:

Marco, you should be ashamed of the way you treat issues.
RTFM answer when there is real and huge problem, seriously?!

@doctrinebot commented on GitHub (May 13, 2013): Comment created by coviex: Marco, you should be ashamed of the way you treat issues. RTFM answer when there is real and huge problem, seriously?!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2579