Version: 2.7
Naming strategy
When mapping your entities to database tables and columns, their names will be defined by naming strategy. There are 2 basic naming strategies you can choose from:
UnderscoreNamingStrategy
- default ofMySqlDriver
andSqliteDriver
MongoNamingStrategy
- default ofMongoDriver
You can override this when initializing ORM. You can also provide your own naming strategy, just
implement NamingStrategy
interface and provide your implementation when bootstrapping ORM:
#
Naming strategy in mongo driverMongoNamingStrategy
will simply use all field names as they are defined. Collection names will
be translated into lower-cased dashed form:
MyCoolEntity
will be translated into my-cool-entity
collection name.
#
Naming strategy in SQL driversMySqlDriver
defaults to UnderscoreNamingStrategy
, which means your all your database tables and
columns will be lower-cased and words divided by underscored: