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.
/*** @Entity **/
class MyEntity // db table will by default be "MyEntity"
protected $myProperty; // defaults to table column "myProperty"
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.
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.
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?
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.
Comment created by @beberlei:
This issue is referenced in Github Pull-Request GH-241
Related Pull Request was closed: #241
Comment created by @guilhermeblanco:
Fixed in abb258c
Issue was closed with resolution "Fixed"