public abstract class AbstractAssociation extends Object
| Constructor and Description |
|---|
AbstractAssociation(String type,
String model)
Creates an instance of the AbstractAssociation.
|
| Modifier and Type | Method and Description |
|---|---|
static AbstractAssociation |
createAssociation(ModelAssociation associationAnnotation,
ModelBean model,
Field field) |
String |
getAssociationKey() |
String |
getForeignKey() |
String |
getModel() |
protected static String |
getModelName(Class<?> model) |
String |
getPrimaryKey() |
String |
getType() |
void |
setAssociationKey(String associationKey)
The name of the property in the data to read the association from.
|
void |
setForeignKey(String foreignKey)
The name of the foreign key on the associated model that links it to the
owner model.
|
void |
setPrimaryKey(String primaryKey)
The name of the primary key on the associated model.
|
public AbstractAssociation(String type, String model)
getType()
and getModel() to the provided parameters.type - The type of the association.model - The name of the model that is being associated with.public String getAssociationKey()
public void setAssociationKey(String associationKey)
Corresponds to the associationKey config property.
associationKey - name of the property in the json datapublic String getForeignKey()
public void setForeignKey(String foreignKey)
Corresponds to the foreignKey config property.
foreignKey - the new name for the foreignKeypublic String getPrimaryKey()
public void setPrimaryKey(String primaryKey)
Model.idProperty().
Corresponds to the primaryKey config property.
primaryKey - the new name for the primaryKeypublic String getType()
public String getModel()
public static AbstractAssociation createAssociation(ModelAssociation associationAnnotation, ModelBean model, Field field)
Copyright © 2010-2013. All Rights Reserved.