|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.ao.atlassian.AtlassianFieldNameConverter
public final class AtlassianFieldNameConverter
Constructor Summary | |
---|---|
AtlassianFieldNameConverter()
|
Method Summary | |
---|---|
java.lang.String |
convertName(java.lang.String name)
|
java.lang.String |
getName(java.lang.reflect.Method method)
Generates a field name to correspond with the specified method. |
java.lang.String |
getPolyTypeName(java.lang.reflect.Method method)
Generates a secondary field name which corresponds with the polymorphic type flag for the field corresponding to the specified method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AtlassianFieldNameConverter()
Method Detail |
---|
public java.lang.String getName(java.lang.reflect.Method method)
FieldNameConverter
getName
in interface FieldNameConverter
method
- The method for which a corresponding field name must be
generated.
public java.lang.String getPolyTypeName(java.lang.reflect.Method method)
FieldNameConverter
Generates a secondary field name which corresponds with the polymorphic
type flag for the field corresponding to the specified method. If the
method in question does not represent a polymorphic field, this method
may return any value, or null
. For most use-cases, the
return value of this method will be identical to that of the
FieldNameConverter.getName(Method)
method with a conventional suffix (usually "Type"
or "_type") to indicate that it is a polymorphic flag. Polymorphic
fields are the only scenario in which two fields will correspond to a
single method.
An example of a table with a polymorphic flagging field could be taken as follows (MySQL DDL):
CREATE TABLE comments ( id INTEGER NOT NULL AUTO_INCREMENT, title VARCHAR(45), text TEXT, commentableID INTEGER, commentableType VARCHAR(255), PRIMARY KEY(id) );
Notice the absence of foreign key constraint on the commentableID
field. This is because this table has a one-to-many mapping with potentially
numerous tables which can be described as "commentable". Thus,
commentableID
and commentableType
describe a
polymorphic one-to-many relationship within the database.
getPolyTypeName
in interface FieldNameConverter
method
- The method for which a corresponding field name must be
generated.
public java.lang.String convertName(java.lang.String name)
convertName
in interface FieldNameProcessor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |