public class WurbletArgument extends Object implements WurbletArgumentOperand
There are 4 WurbletArgumentTypes:
Entity's Attribute that must meet a condition.Entity's Attribute that will be updated.Entity's Attribute.Relation that will be eagerly loaded.An argument is of the form:
[*|+|-][Relation|.Entity[.Relation...]][Attribute[[name]]][:relop[:value|#value]]
Examples:
poolId -> attribute=poolId, arg=poolId, relop="="
poolId[from]:>= -> attribute=poolId, arg=from, relop=">="
code:=:"Hurrz" -> attribute=code, relop="=", value="Hurz"
code:=#"Hurrz" -> attribute=code, relop="=", value="Hurz", literally=true
+poolId -kurzname -> ORDER BY pool_id ASC, kurzname DESC
invoice.lines.currencyId -> SQL WHERE condition for currency_id
.InvoiceLine.currencyId -> equivalent to the above
*invoice.lines -> joins the invoice pointsToComponent together with its lines
invoice*lines -> equivalent to the above
| Constructor and Description |
|---|
WurbletArgument(org.tentackle.model.Entity entity,
int index,
String text,
boolean expressionFinished,
boolean argumentGroupingEnabled)
Constructs a wurblet argument.
|
| Modifier and Type | Method and Description |
|---|---|
WurbletArgumentType |
getArgumentType()
Gets the argument type.
|
org.tentackle.model.Attribute |
getAttribute()
Gets the model attribute.
|
org.tentackle.model.Entity |
getComponent()
Gets the component that prepends the relation path.
|
org.tentackle.model.Entity |
getEntity()
Gets the entity the wurblet is applied to.
|
Set<org.tentackle.model.Entity> |
getExistsComponents()
Gets the components for the current SQL EXISTS clause.
|
Set<org.tentackle.model.Relation> |
getExistsRelations()
Sets the relations used within the current SQL EXISTS clause.
|
List<org.tentackle.model.Relation> |
getExpressionRelations()
Gets the compacted relation path starting with the last component relation in chain, if any.
|
int |
getIndex()
Gets the index within the wurblet anchor.
|
String |
getJdbcValue()
Gets the value to be used in JDBC prepared statements.
|
String |
getMethodArgumentName()
Gets the effective name of the method argument.
This is ether the optionally defined [name] or the name of the Attribute. |
String |
getName()
Gets the optional name of the method argument.
|
List<org.tentackle.model.Relation> |
getRelations()
Gets the relation path.
|
String |
getRelop()
Gets the relop string.
|
org.tentackle.model.SortType |
getSortType()
Gets the sorting type if this a sorting criteria argument.
|
String |
getText()
Gets the original text.
|
String |
getValue()
Gets the predefined value.
|
boolean |
isEndOfExistsClause()
Returns whether this is the last argument of the current SQL EXISTS clause.
|
boolean |
isMethodArgument()
Returns whether this is a method argument.
|
boolean |
isPath()
Returns whether argument points to another entity.
|
boolean |
isValueLiterally()
fixed value (directly put into sql-statement).
|
void |
setEndOfExistsClause(boolean endOfExistsClause)
Sets whether this is the last argument of the current SQL EXISTS clause.
|
void |
setExistsComponents(Set<org.tentackle.model.Entity> existsComponents)
Sets the components for the current SQL EXISTS clause.
|
void |
setExistsRelations(Set<org.tentackle.model.Relation> existsRelations)
Sets the relations used within the current SQL EXISTS clause.
|
String |
toString() |
public WurbletArgument(org.tentackle.model.Entity entity,
int index,
String text,
boolean expressionFinished,
boolean argumentGroupingEnabled)
throws org.wurbelizer.wurbel.WurbelException
entity - the entity the wurblet is applied toindex - the position among all argumentstext - the wurblet argexpressionFinished - true if expression is finishedargumentGroupingEnabled - true if argument grouping is enabledorg.wurbelizer.wurbel.WurbelException - if parsing failedpublic org.tentackle.model.Entity getEntity()
public int getIndex()
public String getText()
public WurbletArgumentType getArgumentType()
public org.tentackle.model.Attribute getAttribute()
public List<org.tentackle.model.Relation> getRelations()
If the path starts with a component, the relations start there.
public Set<org.tentackle.model.Relation> getExistsRelations()
public void setExistsRelations(Set<org.tentackle.model.Relation> existsRelations)
existsRelations - the effective relationspublic Set<org.tentackle.model.Entity> getExistsComponents()
public void setExistsComponents(Set<org.tentackle.model.Entity> existsComponents)
existsComponents - the componentspublic boolean isEndOfExistsClause()
public void setEndOfExistsClause(boolean endOfExistsClause)
endOfExistsClause - true if finish clausepublic List<org.tentackle.model.Relation> getExpressionRelations()
public org.tentackle.model.Entity getComponent()
public boolean isPath()
public org.tentackle.model.SortType getSortType()
public String getName()
public boolean isMethodArgument()
public String getMethodArgumentName() throws org.wurbelizer.wurbel.WurbelException
[name] or the name of the Attribute.org.wurbelizer.wurbel.WurbelException - if arhument type provides no argument namepublic String getJdbcValue() throws org.wurbelizer.wurbel.WurbelException
org.wurbelizer.wurbel.WurbelException - if failedpublic String getRelop()
public String getValue()
public boolean isValueLiterally()
Tentackle - distributed, domain- and model-driven