Doctrine does not (and will not) support DEFAULT values set at DDL level, and treats the in-memory entity as authoritative at all times.
You can: * avoid mapping those entity fields at all (doctrine will skip those fields in all queries) * move the GUID (or generally default logic) to your entity's constructor Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Tue, Sep 27, 2016 at 5:16 PM, 'Dominik Echterbruch' via doctrine-user < [email protected]> wrote: > Hello. > > I wonder if there is a possibility to remove the column from the INSERT >> statement while still being able to SELECT the column. >> > > In fact, this was the right thought for a very dirty workaround. I now > have two entites whereof one holds all the columns except for rowguid and > the other only holds id and rowguid. By this means I can insert with the > one entity and read the rowguid from the other entity. > > But this really is an evil workaround, as it forces me to do another > SELECT with all the overhead that is caused by this (additional object to > be populated, etc.). I'd really appreciate a solution where the > auto-generated default value is automagically pulled from the database upon > persisting the object. Perhaps there could be a new column configuration > option that allows for "don't include in query except a value was > explicitly passed in". > > So the question is still open for useful responses... > > Best regards, > Dominik > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
