mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-559: Allow table name and column names to be modified by a user-supplied inflector #692
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Apr 29, 2010).
Jira issue originally created by user mjh_ca:
With the annotation mapping driver, table names default to the same as the class name, and table columns default to the same name as the field (class property) name.
It would be great if we could override this behavior by passing in a custom inflector. So for example you could default all camelCase fields to be underscore_separated as column names in the database without needing to manually specify this in the annotations.
@doctrinebot commented on GitHub (Apr 30, 2010):
Comment created by romanb:
I think Hibernate, for example, has naming strategies for this and you can implement your own custom NamingStrategy that implements a specific (default) naming convention. Maybe we want a similar approach.
@doctrinebot commented on GitHub (May 21, 2010):
Comment created by shurakai:
Whats a use case for this? One could use individual table / column names via hardcoding. (@table, i guess. see manual) Is this unwanted?
@doctrinebot commented on GitHub (May 22, 2010):
Comment created by mjh_ca:
Sure there is a use case. With a large schema, hardcoding via individual @table and @column annotations is error-prone. A global "default" inflector (or naming strategy, as Roman suggests) would much cleaner. Allowing customization of "defaults" doesn't seem unreasonable to me.
@doctrinebot commented on GitHub (Dec 23, 2011):
Comment created by @beberlei:
This issue is referenced in Github Pull-Request GH-241
https://github.com/doctrine/doctrine2/pull/241
@doctrinebot commented on GitHub (Dec 24, 2011):
Comment created by @beberlei:
Related Pull Request was closed: https://github.com/doctrine/doctrine2/pull/241
@doctrinebot commented on GitHub (Dec 24, 2011):
Comment created by @guilhermeblanco:
Fixed in
abb258c951@doctrinebot commented on GitHub (Dec 24, 2011):
Issue was closed with resolution "Fixed"