jodd.db.orm.sqlgen.fk
Class DefaultFkNamingConvention
java.lang.Object
jodd.db.orm.sqlgen.fk.DefaultFkNamingConvention
- All Implemented Interfaces:
- FkNamingConvention
public class DefaultFkNamingConvention
- extends java.lang.Object
- implements FkNamingConvention
Default FK naming convention uses foreign table column name and, optionally, table name.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
useTableName
protected final boolean useTableName
optPrefix
protected java.lang.String optPrefix
DefaultFkNamingConvention
public DefaultFkNamingConvention()
DefaultFkNamingConvention
public DefaultFkNamingConvention(boolean useTableName)
DefaultFkNamingConvention
public DefaultFkNamingConvention(java.lang.String optPrefixToRemove)
resolveFkName
public java.lang.String resolveFkName(DbEntityDescriptor foreignTable,
DbEntityDescriptor thisTable)
- Resolve foreign key name from foreign table and this table.
Example:
Lets have table GIRL that has an ID column. Lets have table BOY that has a foreign key to a GIRL.
In this example, method will receive following arguments:
- foreignTable = (GIRL)
- thisTable = (BOY)
The resulting foreign key might be: "GIRL_ID".
- Specified by:
resolveFkName
in interface FkNamingConvention
Copyright ©2008 Jodd Team