Module org.eclipse.persistence.core
Class ForeignReferenceQueryKey
- java.lang.Object
-
- org.eclipse.persistence.mappings.querykeys.QueryKey
-
- org.eclipse.persistence.mappings.querykeys.ForeignReferenceQueryKey
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
DirectCollectionQueryKey,ManyToManyQueryKey,OneToManyQueryKey,OneToOneQueryKey
public class ForeignReferenceQueryKey extends QueryKey
Purpose: Define an alias to a foreign object.
Responsibilities:
- Define the reference class of the foreign object.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpressionjoinCriteriaprotected Class<?>referenceClassprotected StringreferenceClassName-
Fields inherited from class org.eclipse.persistence.mappings.querykeys.QueryKey
descriptor, name
-
-
Constructor Summary
Constructors Constructor Description ForeignReferenceQueryKey()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvertClassNamesToClasses(ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this project to actual class-based settingsExpressiongetJoinCriteria()PUBLIC: Return the join expression for the relationship defined by the query key.Class<?>getReferenceClass()PUBLIC: Return the reference class of the relationship.StringgetReferenceClassName()PUBLIC: Return the reference class name of the relationship.DatabaseTablegetReferenceTable(ClassDescriptor desc)PUBLIC: Returns the reference table.DatabaseTablegetRelationTable(ClassDescriptor referenceDescriptor)PUBLIC: Returns the relation table.DatabaseTablegetSourceTable()PUBLIC: Returns the source table.booleanisForeignReferenceQueryKey()INTERNAL: override the isForeignReferenceQueryKey() method in the superclass to return true.voidsetJoinCriteria(Expression joinCriteria)PUBLIC: Set the join expression for the relationship defined by the query key.voidsetReferenceClass(Class<?> referenceClass)PUBLIC: Set the reference class of the relationship.voidsetReferenceClassName(String referenceClassName)PUBLIC: Set the reference class name for this relationship This is used when projects are built without using classes-
Methods inherited from class org.eclipse.persistence.mappings.querykeys.QueryKey
clone, getDescriptor, getName, initialize, isAbstractQueryKey, isCollectionQueryKey, isDirectCollectionQueryKey, isDirectQueryKey, isManyToManyQueryKey, isOneToManyQueryKey, isOneToOneQueryKey, isQueryKey, setDescriptor, setName, toString
-
-
-
-
Field Detail
-
referenceClass
protected Class<?> referenceClass
-
referenceClassName
protected String referenceClassName
-
joinCriteria
protected Expression joinCriteria
-
-
Method Detail
-
convertClassNamesToClasses
public void convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this project to actual class-based settings- Overrides:
convertClassNamesToClassesin classQueryKey
-
getJoinCriteria
public Expression getJoinCriteria()
PUBLIC: Return the join expression for the relationship defined by the query key.
-
getReferenceClass
public Class<?> getReferenceClass()
PUBLIC: Return the reference class of the relationship.
-
getReferenceClassName
public String getReferenceClassName()
PUBLIC: Return the reference class name of the relationship.
-
isForeignReferenceQueryKey
public boolean isForeignReferenceQueryKey()
INTERNAL: override the isForeignReferenceQueryKey() method in the superclass to return true.- Overrides:
isForeignReferenceQueryKeyin classQueryKey- Returns:
- boolean
-
setJoinCriteria
public void setJoinCriteria(Expression joinCriteria)
PUBLIC: Set the join expression for the relationship defined by the query key.Example:
builder.getField("ADDRESS.ADDRESS_ID").equal(builder.getParameter("EMPLOYEE.ADDR_ID");
-
setReferenceClass
public void setReferenceClass(Class<?> referenceClass)
PUBLIC: Set the reference class of the relationship. This is not required for direct collection query keys.
-
setReferenceClassName
public void setReferenceClassName(String referenceClassName)
PUBLIC: Set the reference class name for this relationship This is used when projects are built without using classes
-
getSourceTable
public DatabaseTable getSourceTable()
PUBLIC: Returns the source table.
-
getReferenceTable
public DatabaseTable getReferenceTable(ClassDescriptor desc)
PUBLIC: Returns the reference table.
-
getRelationTable
public DatabaseTable getRelationTable(ClassDescriptor referenceDescriptor)
PUBLIC: Returns the relation table. Currently only ManyToMany and OneToOne may have relation table. The method is overridden to return null for other subclasses. The returned relationTable still could be null.
-
-