public class RelationImpl extends Object implements Relation, Comparable<RelationImpl>
| Constructor and Description |
|---|
RelationImpl(Entity entity,
SourceInfo sourceInfo)
Creates a relation.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(RelationImpl o) |
ModelException |
createModelException(String message)
Creates a model exception.
|
boolean |
equals(Object obj) |
AccessScope |
getAccessScope()
Gets the access scope for generated methods.
|
List<String> |
getAnnotations()
list of annotations.
|
Attribute |
getAttribute()
Gets the associated attribute.
|
String |
getClassName()
Gets the name of the related class.
|
String |
getComment()
Gets the comment.
|
String |
getDeclaredJavaType()
Gets the declared java type of the relation.
|
Relation |
getDefiningNmRelation()
Gets the relation of the entity defining the nm-relation.
|
Entity |
getEntity()
Gets the entity this relation belongs to.
|
Attribute |
getForeignAttribute()
Gets the foreign attribute.
|
Entity |
getForeignEntity()
Gets the related entity.
|
Relation |
getForeignRelation()
Gets the foreign (opposite) relation.
|
String |
getGetterName()
Gets the getter method name.
|
String |
getGetterSetterComment()
Gets the comment line for getter and setter.
|
String |
getJavaType()
Gets the effective java type of the relation.
|
String |
getLinkMethodIndex()
Returns the optional link method index parameter.
|
String |
getLinkMethodName()
Gets the name for the link method.
|
List<String> |
getMethodArgs()
Gets the method arguments for select- and delete-methods.
|
String |
getMethodName()
Gets the name-part for select- and delete-methods.
|
String |
getMethodNameSuffix()
Gets the suffix to be used in methodnames.
|
String |
getName()
Gets the name of this relation.
By default the name is the className with the first character in lowercase. |
String |
getNmMethodName()
Same as
Relation.getMethodName() but for nm relation. |
String |
getNmName()
Gets the name of the nm-relation.
|
Relation |
getNmRelation()
Gets the N:M relation of the foreign entity.
|
RelationType |
getRelationType()
Gets the relation type.
|
SelectionType |
getSelectionType()
Gets the selection type.
|
String |
getSelectionWurbletArguments()
Gets the optional wurblet arguments.
Only available for composite list relations. |
String |
getSetterName()
Gets the setter method name.
|
RelationLine |
getSourceLine()
Gets the source line.
|
String |
getVariableName()
Gets the variable name.
|
int |
hashCode() |
boolean |
isClearOnRemoteSave()
Returns whether the relation should be cleared before save.
Used for non-composite serialized relations that should not be transmitted to the server. |
boolean |
isComposite()
Returns whether the relation points to components of a composite.
|
boolean |
isDeepReference()
Returns whether this relation is a deep reference.
Deep references point to components of another composite entity. |
boolean |
isDeletionCascaded()
Returns whether deletion is cascaded to elements in lists.
|
boolean |
isDeletionFromMainClass()
Returns whether delete method is invoked on main class instead of relation class.
|
boolean |
isProcessed()
Returns whether a process-method is invoked after initialization, select and before save.
The method has the same name as the getter with "get" replaced by "process" and must be provided by the application. This flag applies to composite relations only. |
boolean |
isReadOnly()
Returns whether the relation is read only.
|
boolean |
isReferenced()
Returns whether the parent object is referenced by a variable.
|
boolean |
isReversed()
Returns whether this is list relation with only one element.
A.k.a. |
boolean |
isSelectionCached()
Returns whether the select method is a caching one.
|
boolean |
isSelectionFromMainClass()
Returns whether select method is invoked on main class instead of relation class.
|
boolean |
isSerialized()
Returns whether the relation is serialized.
Used for non-composite relations to make them non-transient. |
boolean |
isTracked()
Returns whether the modification state of the relation is available.
|
boolean |
isWriteOnly()
Returns whether the relation is write-only.
|
void |
parse(Entity entity,
RelationLine line)
Parses a relation line.
|
void |
setAccessScope(AccessScope accessScope) |
void |
setAnnotations(List<String> annotations) |
void |
setAttribute(Attribute attribute) |
void |
setClassName(String className) |
void |
setClearOnRemoteSave(boolean clearOnRemoteSave) |
void |
setComment(String comment) |
void |
setComposite(boolean composite) |
void |
setDeepReference(boolean deepReference) |
void |
setDefiningNmRelation(Relation definingNmRelation) |
void |
setDeletionCascaded(boolean deletionCascaded) |
void |
setDeletionFromMainClass(boolean deletionFromMainClass) |
void |
setForeignAttribute(Attribute foreignAttribute) |
void |
setForeignEntity(Entity foreignEntity) |
void |
setForeignRelation(Relation foreignRelation) |
void |
setLinkMethodIndex(String linkMethodIndex) |
void |
setLinkMethodName(String linkMethodName) |
void |
setMethodArgs(List<String> methodArgs) |
void |
setMethodName(String methodName) |
void |
setName(String name) |
void |
setNmMethodName(String nmMethodName) |
void |
setNmName(String nmName) |
void |
setNmRelation(Relation nmRelation) |
void |
setProcessed(boolean processed) |
void |
setReadOnly(boolean readOnly) |
void |
setReferenced(boolean referenced) |
void |
setRelationType(RelationType relationType) |
void |
setReversed(boolean reversed) |
void |
setSelectionCached(boolean selectionCached) |
void |
setSelectionFromMainClass(boolean selectionFromMainClass) |
void |
setSelectionType(SelectionType selectionType) |
void |
setSelectionWurbletArguments(String selectionWurbletArguments) |
void |
setSerialized(boolean serialized) |
void |
setSourceLine(RelationLine sourceLine) |
void |
setTracked(boolean tracked) |
void |
setWriteOnly(boolean writeOnly) |
String |
toString() |
void |
validate()
Validates the relation.
|
public RelationImpl(Entity entity, SourceInfo sourceInfo)
entity - the entity this relation belongs tosourceInfo - the source infopublic int compareTo(RelationImpl o)
compareTo in interface Comparable<RelationImpl>public void parse(Entity entity, RelationLine line) throws ModelException
entity - the entityline - the source lineModelException - if parsing the model failedpublic Entity getEntity()
Relationpublic List<String> getAnnotations()
RelationgetAnnotations in interface Relationpublic String getGetterSetterComment()
RelationgetGetterSetterComment in interface Relationpublic void validate()
throws ModelException
Relationvalidate in interface RelationModelException - if validation failedpublic String getName()
Relationpublic void setName(String name)
public RelationLine getSourceLine()
RelationgetSourceLine in interface Relationpublic void setSourceLine(RelationLine sourceLine)
public ModelException createModelException(String message)
Refers to the source line if set, otherwise just the message.
message - the messagepublic String getComment()
RelationgetComment in interface Relationpublic String getClassName()
RelationgetClassName in interface Relationpublic RelationType getRelationType()
RelationgetRelationType in interface Relationpublic AccessScope getAccessScope()
RelationgetAccessScope in interface Relationpublic Attribute getAttribute()
RelationgetAttribute in interface Relationpublic Entity getForeignEntity()
RelationgetForeignEntity in interface Relationpublic Attribute getForeignAttribute()
RelationgetForeignAttribute in interface Relationpublic Relation getForeignRelation()
RelationgetForeignRelation in interface Relationpublic Relation getNmRelation()
RelationgetNmRelation in interface Relationpublic Relation getDefiningNmRelation()
RelationgetDefiningNmRelation in interface Relationpublic boolean isComposite()
RelationisComposite in interface Relationpublic boolean isTracked()
Relationpublic boolean isReferenced()
RelationisReferenced in interface Relationpublic boolean isProcessed()
RelationisProcessed in interface Relationpublic boolean isReadOnly()
RelationisReadOnly in interface Relationpublic boolean isWriteOnly()
RelationisWriteOnly in interface Relationpublic boolean isSerialized()
RelationisSerialized in interface Relationpublic boolean isClearOnRemoteSave()
RelationisClearOnRemoteSave in interface Relationpublic boolean isReversed()
RelationisReversed in interface Relationpublic String getMethodName()
RelationgetMethodName in interface Relationpublic List<String> getMethodArgs()
RelationgetMethodArgs in interface Relationpublic String getNmName()
Relationpublic String getNmMethodName()
RelationRelation.getMethodName() but for nm relation.getNmMethodName in interface Relationpublic String getLinkMethodName()
RelationgetLinkMethodName in interface Relationpublic String getLinkMethodIndex()
RelationgetLinkMethodIndex in interface Relationpublic SelectionType getSelectionType()
RelationgetSelectionType in interface Relationpublic boolean isSelectionFromMainClass()
RelationisSelectionFromMainClass in interface Relationpublic boolean isSelectionCached()
RelationisSelectionCached in interface Relationpublic String getSelectionWurbletArguments()
RelationgetSelectionWurbletArguments in interface Relationpublic boolean isDeletionFromMainClass()
RelationisDeletionFromMainClass in interface Relationpublic boolean isDeletionCascaded()
RelationisDeletionCascaded in interface Relationpublic void setNmRelation(Relation nmRelation)
public void setDefiningNmRelation(Relation definingNmRelation)
public void setAttribute(Attribute attribute)
public void setForeignEntity(Entity foreignEntity)
public void setForeignAttribute(Attribute foreignAttribute)
public void setForeignRelation(Relation foreignRelation)
public void setClassName(String className)
public void setComment(String comment)
public void setComposite(boolean composite)
public void setLinkMethodName(String linkMethodName)
public void setNmName(String nmName)
public void setNmMethodName(String nmMethodName)
public void setMethodName(String methodName)
public void setReadOnly(boolean readOnly)
public void setReferenced(boolean referenced)
public void setProcessed(boolean processed)
public void setRelationType(RelationType relationType)
public void setSerialized(boolean serialized)
public void setClearOnRemoteSave(boolean clearOnRemoteSave)
public void setReversed(boolean reversed)
public void setTracked(boolean tracked)
public void setWriteOnly(boolean writeOnly)
public void setSelectionType(SelectionType selectionType)
public void setSelectionCached(boolean selectionCached)
public void setSelectionFromMainClass(boolean selectionFromMainClass)
public void setSelectionWurbletArguments(String selectionWurbletArguments)
public void setAccessScope(AccessScope accessScope)
public void setDeletionCascaded(boolean deletionCascaded)
public void setDeletionFromMainClass(boolean deletionFromMainClass)
public void setLinkMethodIndex(String linkMethodIndex)
public String getVariableName()
getVariableName in interface Relationpublic String getMethodNameSuffix()
Example:
"set" + getMethodNameSuffix() would return "setBlah" if the classname is "Blah" or the name is "blah".
getMethodNameSuffix in interface Relationpublic String getGetterName()
RelationgetGetterName in interface Relationpublic String getSetterName()
RelationgetSetterName in interface Relationpublic String getDeclaredJavaType()
RelationgetDeclaredJavaType in interface Relationpublic String getJavaType()
RelationExample: the effective type is ArrayList and the declared type is List.
getJavaType in interface Relationpublic boolean isDeepReference()
RelationisDeepReference in interface Relationpublic void setDeepReference(boolean deepReference)
Copyright © 2016 Krake Softwaretechnik. All rights reserved.