QEloquent 1.1.0
Qt most flexible ORM.
Loading...
Searching...
No Matches
QEloquent::NamingConvention Class Referenceabstract

Interface for naming conventions. More...

#include <namingconvention.h>

Inherited by QEloquent::LaravelNamingConvention, and QEloquent::OneOneNamingConvention.

Public Member Functions

virtual ~NamingConvention ()=default
 Virtual destructor.
 
virtual QString tableName (const QString &className) const =0
 Returns the table name for a given class name.
 
virtual QString fieldName (const QString &propertyName, const QString &tableName) const =0
 Returns the field name for a given property name in a table.
 
virtual QString primaryFieldName (const QString &tableName) const =0
 Returns the name of the primary key field for a table.
 
virtual QString foreignFieldName (const QString &primaryFieldName, const QString &tableName) const =0
 Returns the foreign key field name referring to another table.
 
virtual QString pivotTableName (const QString &table1, const QString &table2) const =0
 Returns the name of the pivot table for a many-to-many relationship.
 
virtual QString propertyName (const QString &fieldName, const QString &tableName) const =0
 Returns the property name for a given field name in a table.
 
virtual QString foreignPropertyName (const QString &primaryPropertyName, const QString &className) const
 Returns the foreign property name (e.g. for relations)
 

Static Public Member Functions

static NamingConventionconvention (const QString &name=QStringLiteral("Laravel"))
 Retrieves a registered naming convention by name.
 

Detailed Description

Interface for naming conventions.

NamingConvention is responsible for translating between C++ class/property names and database table/field names.


The documentation for this class was generated from the following files: