Package org.openbravo.service.json
Class JoinDefinition
- java.lang.Object
-
- org.openbravo.service.json.JoinDefinition
-
public class JoinDefinition extends Object
Used to define entity joins for the queries built through theAdvancedQueryBuilder
.
-
-
Constructor Summary
Constructors Constructor Description JoinDefinition(AdvancedQueryBuilder queryBuilder)
Builds a new entity join definition
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getJoinAlias()
String
getJoinStatement()
Property
getProperty()
String
getPropertyPath()
JoinDefinition
setFetchJoin(boolean fetchJoin)
Sets whether a fetch join must be usedJoinDefinition
setJoinWithClause(String joinWithClause)
Sets a conditional clause to be considered when joining the entitiesJoinDefinition
setOwnerAlias(String ownerAlias)
Sets the alias of the owner of the joining propertyJoinDefinition
setProperty(Property property)
Sets the joining propertyJoinDefinition
setPropertyPath(String propertyPath)
Sets the property path of the joining property.JoinDefinition
setUnrelatedEntityJoin(String entityName, String propertyName)
Sets this join definition as a join with an unrelated entity, i.e., an entity which is not referenced by the main entity of the query.
-
-
-
Constructor Detail
-
JoinDefinition
public JoinDefinition(AdvancedQueryBuilder queryBuilder)
Builds a new entity join definition- Parameters:
queryBuilder
- TheAdvancedQueryBuilder
instance. It can be used to access to information related to the query being built
-
-
Method Detail
-
getJoinStatement
public String getJoinStatement()
- Returns:
- the HQL statement built with the join definition
-
setProperty
public JoinDefinition setProperty(Property property)
Sets the joining property- Parameters:
property
- The joining property- Returns:
- the JoinDefinition instance, for method chaining
-
getProperty
public Property getProperty()
- Returns:
- the joining property
-
setPropertyPath
public JoinDefinition setPropertyPath(String propertyPath)
Sets the property path of the joining property. It may be used as an alternative for thesetProperty(Property)
method.- Parameters:
propertyPath
- The property path of the joining property- Returns:
- the JoinDefinition instance, for method chaining
-
getPropertyPath
public String getPropertyPath()
- Returns:
- the joining property path
-
getJoinAlias
public String getJoinAlias()
- Returns:
- the alias given to the join
-
setOwnerAlias
public JoinDefinition setOwnerAlias(String ownerAlias)
Sets the alias of the owner of the joining property- Parameters:
ownerAlias
- The alias of the owner of the joining property- Returns:
- the JoinDefinition instance, for method chaining
-
setFetchJoin
public JoinDefinition setFetchJoin(boolean fetchJoin)
Sets whether a fetch join must be used- Parameters:
fetchJoin
- True to use fetch when joining the entities or false to not use it- Returns:
- the JoinDefinition instance, for method chaining
-
setJoinWithClause
public JoinDefinition setJoinWithClause(String joinWithClause)
Sets a conditional clause to be considered when joining the entities- Parameters:
joinWithClause
- The conditional clause for the join- Returns:
- the JoinDefinition instance, for method chaining
-
setUnrelatedEntityJoin
public JoinDefinition setUnrelatedEntityJoin(String entityName, String propertyName)
Sets this join definition as a join with an unrelated entity, i.e., an entity which is not referenced by the main entity of the query.- Parameters:
entityName
- The name of the unrelated entitypropertyName
- The name of the property of the unrelated entity to be used for the joining- Returns:
- the JoinDefinition instance, for method chaining
- Throws:
CheckException
- if there is no entity with the provided name or if it exists but there is no property with the given property name in that entity
-
-